PATCH: pgbench - random sampling of transaction written into log - Mailing list pgsql-hackers

From Tomas Vondra
Subject PATCH: pgbench - random sampling of transaction written into log
Date
Msg-id 9aecf17dfb889cd3e5c0860f73298c14.squirrel@sq.gransy.com
Whole thread Raw
Responses Re: PATCH: pgbench - random sampling of transaction written into log
List pgsql-hackers
Hi,

attached is a patch that adds support for random sampling in pgbench, when
it's executed with "-l" flag. You can do for example this:

  $ pgbench -l -T 120 -R 1 db

and then only 1% of transactions will be written into the log file. If you
omit the tag, all the transactions are written (i.e. it's backward
compatible).

Recently I've been using pgbench on hardware that can handle a lot of
transactions (various flavors of SSDs, lots of RAM, ...), and in such
cases the log files may get pretty big (even several gigabytes for a
single 1-hour run). A reasonable random sample (along with the stats
provided by pgbench itself) is often more than enough in such cases.

kind regards
Tomas
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: default_isolation_level='serializable' crashes on Windows
Next
From: "Tomas Vondra"
Date:
Subject: PATCH: pgbench - aggregation of info written into log