pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Add libpq pipeline mode support to pgbench
4+ messages / 3 participants
[nested] [flat]
* pgsql: Add libpq pipeline mode support to pgbench
@ 2021-03-15 21:35 Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 1 reply; 4+ messages in thread
From: Alvaro Herrera @ 2021-03-15 21:35 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Add libpq pipeline mode support to pgbench
New metacommands \startpipeline and \endpipeline allow the user to run
queries in libpq pipeline mode.
Author: Daniel Vérité <daniel@manitou-mail.org>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/b4e34135-2bd9-4b8a-94ca-27d760da26d7@manitou-mail.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9aa491abbf07ca8385a429385be8d68517384fdf
Modified Files
--------------
doc/src/sgml/ref/pgbench.sgml | 22 +++++
src/bin/pgbench/pgbench.c | 131 ++++++++++++++++++++++++---
src/bin/pgbench/t/001_pgbench_with_server.pl | 79 +++++++++++++++-
3 files changed, 216 insertions(+), 16 deletions(-)
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pgsql: Add libpq pipeline mode support to pgbench
@ 2021-03-17 09:17 Fabien COELHO <coelho@cri.ensmp.fr>
parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 1 reply; 4+ messages in thread
From: Fabien COELHO @ 2021-03-17 09:17 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@alvh.no-ip.org>; daniel@manitou-mail.org; +Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Bonjour Daniel, Ola Alvaro,
> Add libpq pipeline mode support to pgbench
>
> New metacommands \startpipeline and \endpipeline allow the user to run
> queries in libpq pipeline mode.
>
> Author: Daniel Vérité <daniel@manitou-mail.org>
> Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
> Discussion: https://postgr.es/m/b4e34135-2bd9-4b8a-94ca-27d760da26d7@manitou-mail.org
I did not notice that the libpq pipeline mode thread had a pgbench patch
attached, otherwise I would have looked at it.
Some minor post-commit comments:
For consistency with the existing \if … \endif, ISTM that it could have
been named \batch … \endbatch or \pipeline … \endpipeline?
ISTM that the constraint checks (nesting, no \[ag]set) could be added to
CheckConditional that could be renamed to CheckScript. That could allow to
simplify the checks in the command execution as mere Asserts.
--
Fabien.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pgsql: Add libpq pipeline mode support to pgbench
@ 2021-03-17 13:24 Daniel Verite <daniel@manitou-mail.org>
parent: Fabien COELHO <coelho@cri.ensmp.fr>
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Verite @ 2021-03-17 13:24 UTC (permalink / raw)
To: Fabien COELHO <coelho@cri.ensmp.fr>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Fabien COELHO wrote:
> For consistency with the existing \if … \endif, ISTM that it could have
> been named \batch … \endbatch or \pipeline … \endpipeline?
"start" mirrors "end". To me, the analogy with \if-\endif is not
obvious.
Grammatically \if is meant to introduce the expression after it,
whereas \startpipeline takes no argument.
Functionally \startpipeline can be thought as "open the valve"
and \endpipeline "close the valve". They're "call-to-action" kinds of
commands, and in that sense quite different from the \if-\endif pair.
Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: https://www.manitou-mail.org
Twitter: @DanielVerite
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pgsql: Add libpq pipeline mode support to pgbench
@ 2021-04-09 23:02 Alvaro Herrera <alvherre@alvh.no-ip.org>
parent: Daniel Verite <daniel@manitou-mail.org>
0 siblings, 0 replies; 4+ messages in thread
From: Alvaro Herrera @ 2021-04-09 23:02 UTC (permalink / raw)
To: Daniel Verite <daniel@manitou-mail.org>; +Cc: Fabien COELHO <coelho@cri.ensmp.fr>; PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
On 2021-Mar-17, Daniel Verite wrote:
> Fabien COELHO wrote:
>
> > For consistency with the existing \if … \endif, ISTM that it could have
> > been named \batch … \endbatch or \pipeline … \endpipeline?
>
> "start" mirrors "end". To me, the analogy with \if-\endif is not
> obvious.
> Grammatically \if is meant to introduce the expression after it,
> whereas \startpipeline takes no argument.
> Functionally \startpipeline can be thought as "open the valve"
> and \endpipeline "close the valve". They're "call-to-action" kinds of
> commands, and in that sense quite different from the \if-\endif pair.
I forgot to reply to this, but I did consider the naming of these
commands before commit, and I tend to side with Daniel here. I think
it's not totally unreasonable to have in the future another command
\syncpipeline which sends does PQpipelineSync(); if the commands are
\pipeline and \endpipeline then a \syncpipeline in the middle makes less
sense than if they are \startpipeline and \endpipeline. I grant this is
quite subjective, though.
--
Álvaro Herrera Valdivia, Chile
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2021-04-09 23:02 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 21:35 pgsql: Add libpq pipeline mode support to pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
2021-03-17 09:17 ` Fabien COELHO <coelho@cri.ensmp.fr>
2021-03-17 13:24 ` Daniel Verite <daniel@manitou-mail.org>
2021-04-09 23:02 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox