Re: Patch to show individual statement latencies in pgbench output
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Smith <greg@2ndquadrant.com>
Cc: Florian Pflug <fgp@phlo.org>, PostgreSQL-development hackers <pgsql-hackers@postgresql.org>
Date: 2010-08-12T21:19:00Z
Lists: pgsql-hackers
Greg Smith <greg@2ndquadrant.com> writes: > I've attached a v5. No real code changes from Florian's version, just > some wording/style fixes and rework on the documentation. I've committed this with some editorialization. The main non-cosmetic change was that I pulled the latency statistics counters out of the per-Command data structures and put them into per-thread arrays instead. I did this for two reasons: 1. Having different threads munging adjacent array entries without any locking makes me itch. On some platforms that could possibly fail entirely, and in any case it's likely to be a performance hit on machines where processors lock whole cache lines (which is most of them these days, I think). 2. It should make it a lot easier to pass the per-thread results back up to the parent in a fork-based implementation, should anyone desire to fix the limitation I mentioned before. regards, tom lane