public inbox for [email protected]
help / color / mirror / Atom feedFrom: Alvaro Herrera <[email protected]>
To: Yugo NAGATA <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Fabien COELHO <[email protected]>
Cc: [email protected]
Subject: Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error
Date: Wed, 8 Feb 2023 13:09:28 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 2022-Sep-30, Yugo NAGATA wrote:
> Well, I still don't understand why we need to prepare only "the
> commands within a pipeline" before starting pipeline. In the current
> behavior, the entire script is prepared in advance just before executing
> the first SQL command in the script, instead of preparing each command
> one by one. This patch also prepare the entire script in advance, so
> there is no behavioural change in this sense.
>
> However, there are a few behavioural changes. One is that the preparation
> is not counted in the command performance statistics as Fabien mentioned.
> Another is that all meta-commands including \shell and \sleep etc. are
> executed before the preparation.
>
> To reduce impact of these changes, I updated the patch to prepare the
> commands just before executing the first SQL command or \startpipeline
> meta-command instead of at the beginning of the script.
I propose instead the following: each command is prepared just before
it's executed, as previously, and if we see a \startpipeline, then we
prepare all commands starting with the one just after, and until the
\endpipeline.
I didn't test additional cases other than the one you submitted.
Testing this I noticed that pg_log_debug et al don't support
multithreading very well -- the lines are interspersed.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
view thread (2+ messages)
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: pgbench: using prepared BEGIN statement in a pipeline could cause an error
In-Reply-To: <[email protected]>
* 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