Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error
Date
Msg-id alpine.DEB.2.22.394.2107170650260.3143659@pseudo
Whole thread Raw
In response to pgbench: using prepared BEGIN statement in a pipeline could cause an error  (Yugo NAGATA <nagata@sraoss.co.jp>)
Responses Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error  (Yugo NAGATA <nagata@sraoss.co.jp>)
Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hello Yugo-san,

> [...] One way to avoid these errors is to send Parse messages before 
> pipeline mode starts. I attached a patch to fix to prepare commands at 
> starting of a script instead of at the first execution of the command.

> What do you think?

ISTM that moving prepare out of command execution is a good idea, so I'm 
in favor of this approach: the code is simpler and cleaner.

ISTM that a minor impact is that the preparation is not counted in the 
command performance statistics. I do not think that it is a problem, even 
if it would change detailed results under -C -r -M prepared.

Patch applies & compiles cleanly, global & local make check ok. However 
the issue is not tested. I think that the patch should add a tap test case 
for the problem being addressed.

I'd suggest to move the statement preparation call in the 
CSTATE_CHOOSE_SCRIPT case.

In comments: not yet -> needed.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: CREATE COLLATION - check for duplicate options and error out if found one
Next
From: Andy Fan
Date:
Subject: Re: UniqueKey on Partitioned table.