pgbench - adding pl/pgsql versions of tests

From: Hannu Krosing <hannuk(at)google(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Dimitri Fontaine <dim(at)tapoueh(dot)org>
Subject: pgbench - adding pl/pgsql versions of tests
Date: 2023-01-04 18:06:44
Message-ID: CAMT0RQR1TNSnSWwd65is=HCDjiP4i25mcDDoctEBEiV8351cMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
pgbench-plpgsql-001.patch application/x-patch 6.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-01-04 18:12:19 Re: wake up logical workers after ALTER SUBSCRIPTION
Previous Message Peter Geoghegan 2023-01-04 17:59:37 Re: pgsql: Delay commit status checks until freezing executes.