public inbox for [email protected]  
help / color / mirror / Atom feed
From: Fujii Masao <[email protected]>
To: Boris Mironov <[email protected]>
Cc: Madyshev Egor <[email protected]>
Cc: Hayato Kuroda (Fujitsu) <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Idea to enhance pgbench by more modes to generate data (multi-TXNs, UNNEST, COPY BINARY)
Date: Fri, 20 Mar 2026 00:29:46 +0900
Message-ID: <CAHGQGwGKAr7GFD5mS3aGi4W4KpmP9wVkbYRWEHOQM8u18qX9Cg@mail.gmail.com> (raw)
In-Reply-To: <PH0PR08MB7020956FB86755AD6B4E2DCF8844A@PH0PR08MB7020.namprd08.prod.outlook.com>
References: <OS9PR01MB121499E64344675A86179219CF579A@OS9PR01MB12149.jpnprd01.prod.outlook.com>
	<PH0PR08MB7020F6EA8877834CCDD5FABB8879A@PH0PR08MB7020.namprd08.prod.outlook.com>
	<[email protected]>
	<SA1PR08MB702308B377B110460FCDADA18847A@SA1PR08MB7023.namprd08.prod.outlook.com>
	<[email protected]>
	<PH0PR08MB7020956FB86755AD6B4E2DCF8844A@PH0PR08MB7020.namprd08.prod.outlook.com>

On Thu, Mar 12, 2026 at 11:28 PM Boris Mironov
<[email protected]> wrote:
>
> Hi Egor,
>
> Thank you very much for your time reviewing this patch
> and guiding through some of its inefficiencies.

I like the idea of improving the performance of the initial data load
in pgbench. That's definitely useful.

I ran some tests on my MacBook (server and pgbench on the same machine)
using different data loading options. Here are the results:

------------------------------------------------
[ Client / Text mode ]
pgbench -i -Idtg -s100
done in 13.38 s (drop tables 0.00 s, create tables 0.01 s, client-side
generate 13.38 s).

pgbench -i -Idtg -s1000
done in 151.81 s (drop tables 0.00 s, create tables 0.01 s,
client-side generate 151.81 s).

[ Client / Binary mode ]
pgbench -i -Idtc -s100
done in 18.32 s (drop tables 0.00 s, create tables 0.01 s, client-side
generate 18.31 s).

pgbench -i -Idtc -s1000
done in 204.48 s (drop tables 0.00 s, create tables 0.01 s,
client-side generate 204.47 s).

[ Server / generate_series ]
pgbench -i -IdtG -s100
done in 21.30 s (drop tables 0.00 s, create tables 0.00 s, server-side
generate 21.30 s).

pgbench -i -IdtG -s1000
done in 230.94 s (drop tables 0.00 s, create tables 0.01 s,
server-side generate 230.93 s).

[ Server / Unnest ]
pgbench -i -IdtU -s100
done in 23.16 s (drop tables 0.00 s, create tables 0.00 s, server-side
generate 23.16 s).

pgbench -i -IdtU -s1000
done in 249.08 s (drop tables 0.00 s, create tables 0.01 s,
server-side generate 249.07 s).
------------------------------------------------

In my tests, text mode was faster than binary mode. Also, on the server side,
generate_series() was faster than unnest().

So I'm wondering if there are specific conditions where binary mode or unnest()
performs better. If not, it may not be worth supporting these additional data
loading options...

Regards,


-- 
Fujii Masao





view thread (21+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Idea to enhance pgbench by more modes to generate data (multi-TXNs, UNNEST, COPY BINARY)
  In-Reply-To: <CAHGQGwGKAr7GFD5mS3aGi4W4KpmP9wVkbYRWEHOQM8u18qX9Cg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox