Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patchespgsql-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

pgsql-performance by date

Next:From: Jan WieckDate: 2006-01-03 04:06:57
Subject: Re: Stats collector performance improvement
Previous:From: Hannu KrosingDate: 2006-01-02 21:48:15
Subject: Re: Stats collector performance improvement

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group