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

Re: Stats collector performance improvement

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: Stats collector performance improvement
Date: 2006-01-03 09:40:53
Message-ID: 1136281253.5052.113.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patchespgsql-performance
On Mon, 2006-01-02 at 16:48 -0500, Tom Lane wrote:

> 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. 

We decided that the stats update had to occur during execution, in case
the statement aborted and row versions were not notified. That means we
must notify things as they happen, yet could use a reliable queuing
system that could suffer a delay in the stats becoming available.

But how often do we lose a backend? Could we simply buffer that a little
better? i.e. don't send message to stats unless we have altered at least
10 rows? So we would buffer based upon the importance of the message,
not the actual size of the message. That way singleton-statements won't
generate the same stats traffic, but we risk losing a buffers worth of
row changes should we crash - everything would still work if we lost a
few small row change notifications.

We can also save lots of cycles on the current statement overhead, which
is currently the worst part of the stats, performance-wise. That
definitely needs redesign. AFAICS we only ever need to know the SQL
statement via the stats system if the statement has been running for
more than a few minutes - the main use case is for an admin to be able
to diagnose a rogue or hung statement. Pushing the statement to stats
every time is just a big overhead. That suggests we should either have a
pull or a deferred push (longer-than-X-secs) approach.

Best Regards, Simon Riggs


In response to

Responses

pgsql-performance by date

Next:From: Simon RiggsDate: 2006-01-03 09:54:57
Subject: Re: Stats collector performance improvement
Previous:From: Jan WieckDate: 2006-01-03 04:06:57
Subject: Re: Stats collector performance improvement

pgsql-hackers by date

Next:From: Simon RiggsDate: 2006-01-03 09:54:57
Subject: Re: Stats collector performance improvement
Previous:From: Magnus HaganderDate: 2006-01-03 09:31:30
Subject: Re: psql & readline & win32

pgsql-patches by date

Next:From: Simon RiggsDate: 2006-01-03 09:54:57
Subject: Re: Stats collector performance improvement
Previous:From: Joe ConwayDate: 2006-01-03 05:09:29
Subject: Re: [BUGS] BUG #2129: dblink problem

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