pgsql: Implement pipeline mode in libpq

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Implement pipeline mode in libpq
Date: 2021-03-15 21:20:08
Message-ID: E1lLudE-0007Jb-Pz@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Implement pipeline mode in libpq

Pipeline mode in libpq lets an application avoid the Sync messages in
the FE/BE protocol that are implicit in the old libpq API after each
query. The application can then insert Sync at its leisure with a new
libpq function PQpipelineSync. This can lead to substantial reductions
in query latency.

Co-authored-by: Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>
Co-authored-by: Matthieu Garrigues <matthieu(dot)garrigues(at)gmail(dot)com>
Co-authored-by: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Reviewed-by: Aya Iwata <iwata(dot)aya(at)jp(dot)fujitsu(dot)com>
Reviewed-by: Daniel Vérité <daniel(at)manitou-mail(dot)org>
Reviewed-by: David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Reviewed-by: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Reviewed-by: Kirk Jamison <k(dot)jamison(at)fujitsu(dot)com>
Reviewed-by: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Reviewed-by: Nikhil Sontakke <nikhils(at)2ndquadrant(dot)com>
Reviewed-by: Vaishnavi Prabakaran <VaishnaviP(at)fast(dot)au(dot)fujitsu(dot)com>
Reviewed-by: Zhihong Yu <zyu(at)yugabyte(dot)com>

Discussion: https://postgr.es/m/CAMsr+YFUjJytRyV4J-16bEoiZyH=4nj+sQ7JP9ajwz=B4dMMZw@mail.gmail.com
Discussion: https://postgr.es/m/CAJkzx4T5E-2cQe3dtv2R78dYFvz+in8PY7A8MArvLhs_pg75gg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/acb7e4eb6b1c614c68a62fb3a6a5bba1af0a2659

Modified Files
--------------
doc/src/sgml/libpq.sgml | 522 +++++++-
doc/src/sgml/lobj.sgml | 4 +
.../libpqwalreceiver/libpqwalreceiver.c | 6 +
src/bin/pg_amcheck/pg_amcheck.c | 2 +
src/interfaces/libpq/exports.txt | 4 +
src/interfaces/libpq/fe-connect.c | 37 +-
src/interfaces/libpq/fe-exec.c | 717 +++++++++--
src/interfaces/libpq/fe-protocol3.c | 77 +-
src/interfaces/libpq/libpq-fe.h | 21 +-
src/interfaces/libpq/libpq-int.h | 60 +-
src/test/modules/Makefile | 1 +
src/test/modules/libpq_pipeline/.gitignore | 5 +
src/test/modules/libpq_pipeline/Makefile | 20 +
src/test/modules/libpq_pipeline/README | 1 +
src/test/modules/libpq_pipeline/libpq_pipeline.c | 1303 ++++++++++++++++++++
.../modules/libpq_pipeline/t/001_libpq_pipeline.pl | 28 +
src/tools/msvc/Mkvcbuild.pm | 9 +-
src/tools/pgindent/typedefs.list | 2 +
18 files changed, 2706 insertions(+), 113 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2021-03-15 21:35:10 pgsql: Add libpq pipeline mode support to pgbench
Previous Message Tom Lane 2021-03-15 16:34:26 pgsql: Work around issues in MinGW-64's setjmp/longjmp support.