Re: Stats collector performance improvement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Stats collector performance improvement
Date: 2006-01-02 21:48:45
Message-ID: 12503.1136238525@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches pgsql-performance

"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2006-01-02 22:20:29 Re: psql & readline & win32
Previous Message Hannu Krosing 2006-01-02 21:48:15 Re: Stats collector performance improvement

Browse pgsql-patches by date

  From Date Subject
Next Message Marko Kreen 2006-01-02 22:55:36 pgcrypto: bug in gen_salt (md5/xdes)
Previous Message Hannu Krosing 2006-01-02 21:48:15 Re: Stats collector performance improvement

Browse pgsql-performance by date

  From Date Subject
Next Message Jan Wieck 2006-01-03 04:06:57 Re: Stats collector performance improvement
Previous Message Hannu Krosing 2006-01-02 21:48:15 Re: Stats collector performance improvement