On Wed, Oct 23, 2013 at 4:34 PM, Stephen Frost <sfr...@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 -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers