Re: pgbench--new transaction type

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgbench--new transaction type
Date: 2012-06-20 07:32:38
Message-ID: 4FE17C96.3090501@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01.06.2012 03:02, Jeff Janes wrote:
> I've attached a new patch which addresses several of your concerns,
> and adds the documentation. The description is much longer than the
> descriptions of other nearby options, which mostly just give a simple
> statement of what they do rather than a description of why that is
> useful. I don't know if that means I'm starting a good trend, or a
> bad one, or I'm just putting the exposition in the wrong place.
>
> In addition to showing the benefits of coding things on the server
> side when that is applicable, it also allows hackers to stress parts
> of the server code that are not easy to stress otherwise.

As you mentioned in your original email over a year ago, most of this
could be done as a custom script. It's nice to have another workload to
test, but then again, there's an infinite number of workloads that might
be interesting.

You can achieve the same with this custom script:

\set loops 512

do $$ DECLARE sum integer default 0; amount integer; account_id
integer; BEGIN FOR i IN 1..:loops LOOP account_id=1 + floor(random() *
:scale); SELECT abalance into strict amount FROM pgbench_accounts
WHERE aid = account_id; sum := sum + amount; END LOOP; END; $$;

It's a bit awkward because it has to be all on one line, and you don't
get the auto-detection of scale. But those are really the only
differences AFAICS.

I think we would be better off improving pgbench to support those things
in custom scripts. It would be nice to be able to write initialization
steps that only run once in the beginning of the test. You could then
put the "SELECT COUNT(*) FROM pgbench_branches" there, to do the scale
auto-detection.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2012-06-20 07:45:56 Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node
Previous Message Simon Riggs 2012-06-20 07:32:28 Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node