Re: Add min and max execute statement time in pg_stat_statement

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Add min and max execute statement time in pg_stat_statement
Дата
Msg-id CAM3SWZT7XCZ9SXSiW+tJvHi+SF1sygp2m1fRKnyuJFgdr0by7g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add min and max execute statement time in pg_stat_statement  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
On Wed, Oct 23, 2013 at 4:34 PM, Stephen Frost <sfrost@snowman.net> wrote:
> Any chance we could accumulate into the histogram in local memory and
> only push to the shared memory on an "infrequent" or at least "less
> frequent" basis?  Apologies, I've not looked into the pg_stat_statements
> bits all that closely, but I can certainly see how having to hold it all
> in shared memory with locking to update would be painful..

I doubt it. That trick I proposed around storing the query text in an
external file is only feasible because we never update the query text,
and we hardly ever care what it actually is in practice. Contrast that
with something that is in a structure protected by a spinlock. You'd
have to keep deltas stashed in TopMemoryContext, and for all kinds of
common cases that just wouldn't work. Plus you have to have some whole
new mechanism for aggregating the stats across backends when someone
expresses an interest in seeing totals.

-- 
Peter Geoghegan



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Add min and max execute statement time in pg_stat_statement
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: Add min and max execute statement time in pg_stat_statement