PATCH: pgbench - random sampling of transaction written into log

From: "Tomas Vondra" <tv(at)fuzzy(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: PATCH: pgbench - random sampling of transaction written into log
Date: 2012-08-24 21:16:15
Message-ID: 9aecf17dfb889cd3e5c0860f73298c14.squirrel@sq.gransy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
pgbench-sampling.diff text/plain 4.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shaun Thomas 2012-08-24 21:22:12 Re: Loose Index Scans by Planner?
Previous Message Kevin Grittner 2012-08-24 19:40:57 Re: Loose Index Scans by Planner?