On Sat, Sep 26, 2015 at 8:38 AM, Robert Haas <robertmh...@gmail.com> wrote: >> QueryDesc's totaltime is for instrumentation information for plugin's >> like pg_stat_statements and we need only the total buffer usage >> of each worker to make it work as the other information is already >> collected in master backend, so I think that should work as I have >> written. > > I don't think that's right at all. First, an extension can choose to > look at any part of the Instrumentation, not just the buffer usage. > Secondly, the buffer usage inside QueryDesc's totaltime isn't the same > as the global pgBufferUsage.
Oh... but I'm wrong. As long as our local pgBufferUsage gets update correctly to incorporate the data from the other workers, the InstrStopNode(queryDesc->totaltime) will suck in those statistics. And the only other things getting updated are nTuples (which shouldn't count anything that the workers did), firsttuple (similarly), and counter (where the behavior is a bit more arguable, but just counting the master's wall-clock time is at least defensible). So now I think you're right: this should be OK. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers