pgbench - adding pl/pgsql versions of tests - Mailing list pgsql-hackers

From Hannu Krosing
Subject pgbench - adding pl/pgsql versions of tests
Date
Msg-id CAMT0RQR1TNSnSWwd65is=HCDjiP4i25mcDDoctEBEiV8351cMQ@mail.gmail.com
Whole thread Raw
Responses Re: pgbench - adding pl/pgsql versions of tests
Re: pgbench - adding pl/pgsql versions of tests
List pgsql-hackers
Hello Hackers,

The attached patch adds pl/pgsql versions of "tpcb-like" and
"simple-update" internal test scripts

The tests perform functionally exactly the same, but are generally
faster as they avoid most client-server latency.

The reason I'd like to have them as part of pgbench are two

1. so I don't have to create the script and function manually each
time I want to test mainly the database (instead of the
client-database system)

2. so that new users of PostgreSQL can easily see how much better OLTP
workloads perform when packaged up as a server-side function

The new user-visible functionalities are two new build-in scripts  -b list :

$ pgbench -b list
Available builtin scripts:
              tpcb-like: <builtin: TPC-B (sort of)>
      plpgsql-tpcb-like: <builtin: TPC-B (sort of) as a pl/pgsql function>
          simple-update: <builtin: simple update>
  plpgsql-simple-update: <builtin: simple update as a pl/pgsql function>
            select-only: <builtin: select only>

which one can run  using the -b / --builtin= option

pgbench -b plpgsql-tpcb-like ...
or
pgbench -b plpgsql-simple-update ...

And a flag --no-functions which lets you not to create the functions at init

there are also character flags to -I / --init ,
-- Y to drop the functions and
-- y to create the functions. Creating is default behaviour, but can
be disabled fia long flag --no-functions )

I selected Yy as they were unused and can be thought of as "inverted
lambda symbol" :)

If there are no strong objections, I'll add it to the commitfest as well

-----
Hannu Krosing
Google Cloud - We have a long list of planned contributions and we are hiring.
Contact me if interested.

Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: pgsql: Delay commit status checks until freezing executes.
Next
From: Nathan Bossart
Date:
Subject: Re: wake up logical workers after ALTER SUBSCRIPTION