pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Qingqing Zhou <zhouqq@cs.toronto.edu>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Stats collector performance improvement
Date: Mon, 02 Jan 2006 16:48:45 -0500
Message-ID: <12503.1136238525@sss.pgh.pa.us> (raw)
In-Reply-To: <dpc4cg$lm6$1@news.hub.org>
References: <200601021840.k02Ieed21704@candle.pha.pa.us>
	<11924.1136233224@sss.pgh.pa.us>
	<dpc4cg$lm6$1@news.hub.org>

"Qingqing Zhou" <zhouqq@cs.toronto.edu> writes:
> AFAICS if we can maintain the stats counts solid, then it may hurt 
> performance dramatically. Think if we maintain 
> pgstat_count_heap_insert()/pgstat_count_heap_delete() pretty well, then we 
> get a replacement of count(*).

Not at all.  For one thing, the stats don't attempt to maintain
per-transaction state, so they don't have the MVCC issues of count(*).
I'm not suggesting any fundamental changes in what is counted or when.

The two compromises that were made in the original stats design to make
it fast were (1) stats updates lag behind reality, and (2) some updates
may be missed entirely.  Now that we have a couple of years' field
experience with the code, it seems that (1) is acceptable for real usage
but (2) not so much.  And it's not even clear that we are buying any
performance gain from (2), considering that it's adding the overhead of
passing the data through an extra process.

			regards, tom lane



view thread (17+ messages)  latest in thread

Message-ID: <12503.1136238525@sss.pgh.pa.us>
Permalink:  ../12503.1136238525@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12503.1136238525@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, zhouqq@cs.toronto.edu, pgsql-hackers@postgresql.org
  Subject: Re: Stats collector performance improvement
  In-Reply-To: <12503.1136238525@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox