Re: pgbench vs. wait events

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench vs. wait events
Date: 2016-10-08 19:26:25
Message-ID: CAMkU=1znjGg_xTSLThQJnMhZS0pWwp62T30R4-t-rHFbufvA7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 7, 2016 at 8:51 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:

>
> I think we need to come up with some benchmarking queries which get more
> work done per round-trip to the database. And build them into the binary,
> because otherwise people won't use them as much as they should if they have
> to pass "-f" files around mailing lists and blog postings. For example,
> we could enclose 5 statements of the TPC-B-like into a single function
> which takes aid, bid, tid, and delta as arguments. And presumably we could
> drop the other two statements (BEGIN and COMMIT) as well, and rely on
> autocommit to get that job done. So we could go from 7 statements to 1.
>

Here is an implementation of that. I've included the calling code as a
patch to pgbench, because if I make it a separate -f file then it is a pain
to get the correct scale and settings of naccounts, etc., into it.

The create script could be integrated into pgbench -i if this is something
we might want to commit.

This gives me an almost 3 fold increase in performance on a system with
fsync turned off:

pgbench -b tpcb-func -T30 -c8 -j8
tps = 24193.197877 (excluding connections establishing)

pgbench -b tpcb-like -T30 -c8 -j8
tps = 8434.746300 (excluding connections establishing)

Cheers,

Jeff

Attachment Content-Type Size
pgbench_transaction.sql text/plain 619 bytes
pgbench_function.patch application/octet-stream 794 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-10-08 20:52:08 Re: Switch to unnamed POSIX semaphores as our preferred sema code?
Previous Message Jeff Janes 2016-10-08 18:22:26 Re: pgbench vs. wait events