Re: Patch to show individual statement latencies in pgbench output

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to show individual statement latencies in pgbench output
Date: 2010-06-16 18:58:55
Message-ID: 6F14BAEE-99C2-4271-94E9-664544C6883D@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jun 14, 2010, at 2:22 , Greg Smith wrote:
> Florian Pflug wrote:
>> To be able to asses the performance characteristics of the different wal-related options, I patched pgbench to show the average latency of each individual statement. The idea is to be able to compare the latency of the COMMIT with the ones of the other statements.
>
> That's an interesting idea, particularly given that people don't really understand where the time is going in the standard pgbench test. Your first bit of review feedback is that this would have to be something you could toggle on and off, there's no way most people want to pay this penalty. If you submit a new patch with a command line option to enable this alternate logging format and add the result to https://commitfest.postgresql.org/action/commitfest_view?id=6 , you can put my name down as a reviewer and I'll take a deeper look at it as part of that.

Thank for offering to review this!

Here is an updated patch that adds a command-line option (-r) to enable/disable per-command latency reporting. It also uses the INSTR_TIME infrastructure that 9.0 provides, and should work correctly in multi-threaded mode. Data is collected per-thread and summarized only for reporting to avoid locking overhead. It now shows all lines for the SQL scripts together with their latencies (zero for comments), not only those containing SQL commands.

I'll add this patch to the next commitfest, and put you down as a reviewer, as you suggested.

best regards,
Florian Pflug

Attachment Content-Type Size
pgbench_statementlatency.patch application/octet-stream 10.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-06-16 19:44:11 Re: 9.0 beta2 pg_upgrade: malloc 0 bytes patch
Previous Message Selena Deckelmann 2010-06-16 18:19:27 Re: ALTER TABLE...ALTER COLUMN vs inheritance