Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Yugo NAGATA <nagata@sraoss.co.jp>, Fabien COELHO <coelho@cri.ensmp.fr>, pgsql-hackers@postgresql.org
Date: 2023-02-06T15:23:01Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> I'm writing my own patch for this problem.  While playing around with
> it, I noticed this:

> struct Command {
>     /* size: 2168, cachelines: 34, members: 11 */
>     /* sum members: 2164, holes: 1, sum holes: 4 */
>     /* last cacheline: 56 bytes */
> };

I think the original intent was for argv[] to be at the end,
which fell victim to ye olde add-at-the-end antipattern.
Cache-friendliness-wise, putting it back to the end would
likely be enough.  But turning it into a variable-size array
would be better from a functionality standpoint.

			regards, tom lane



Commits

  1. Fix pgbench in prepared mode with an empty pipeline

  2. pgbench: Prepare commands in pipelines in advance

  3. Add -M (query mode) option per ITAGAKI Takahiro