Re: Status of autovacuum and the sporadic stats failures ? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Status of autovacuum and the sporadic stats failures ?
Date
Msg-id 20818.1170876630@sss.pgh.pa.us
Whole thread Raw
In response to Re: Status of autovacuum and the sporadic stats failures ?  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Status of autovacuum and the sporadic stats failures ?  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> We could make it cleaner by inventing a function to clear out the cached
>> statistics within a transaction, perhaps "pg_stat_reset_snaphot()" or
>> some such name.  If anyone thinks that that would be of general
>> usefulness, I'll see about making it happen.

> I came up with the idea of storing the stat hash in a particular memory
> context, and have a flag in pgstat.c that's reset when that context is
> reset.  So each caller can define what's the appropriate lifetime.

None of your use-cases require tracking multiple sets of stats within a
transaction, so I don't see why bother with that when we can just add a
"flush the stats" call.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Chatter on DROP SOMETHING IF EXISTS
Next
From: Bruce Momjian
Date:
Subject: Subject supressed