Re: [HACKERS] PATCH: Batch/pipelining support for libpq

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Kyotaro HORIGUCHI" <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: vaishnaviprabakaran(at)gmail(dot)com,michael(dot)paquier(at)gmail(dot)com,daniel(at)yesql(dot)se,craig(at)2ndquadrant(dot)com,andres(at)anarazel(dot)de,david(at)pgmasters(dot)net,VaishnaviP(at)fast(dot)au(dot)fujitsu(dot)com,kommi(dot)haribabu(at)gmail(dot)com,tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com,dmitigr(at)gmail(dot)com,pgsql-hackers(at)postgresql(dot)org,m(dot)kniep(at)web(dot)de,fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp,iwata(dot)aya(at)jp(dot)fujitsu(dot)com
Subject: Re: [HACKERS] PATCH: Batch/pipelining support for libpq
Date: 2018-03-23 13:18:09
Message-ID: fa497dfa-348a-4fc7-89a2-e00e56544231@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kyotaro HORIGUCHI wrote:

> A disucssion on psql batch mode was held in another branch of
> this thread. How do we treat that?

There's a batch mode for pgbench in a patch posted in [1],
with \beginbatch and \endbatch commands, but nothing
for psql AFAICS.
psql is more complicated because currently it uses a
blocking PQexec() call at its core. Craig mentioned psql
integration in [2] and [3].
Also a script can have inter-query dependencies such as in
insert into table(...) returning id \gset
update othertable set col= :id where ...;
which is a problem in batch mode, as we don't want
to send the update before the right value for :id is
known. Whether we want to support these dependencies
and how needs discussion.
For instance we might not support them at all, or
create a synchronization command that collects
all results of queries sent so far, or do it implicitly
when a variable is injected into a query...
This looks like substantial work that might be best
done separately from the libpq patch.

[1]
https://www.postgresql.org/message-id/b4e34135-2bd9-4b8a-94ca-27d760da26d7@manitou-mail.org
[2]
https://www.postgresql.org/message-id/CAMsr+YGLhaDkjymLuNVQy4MrSKQoA=F1vO=aN8XQf30N=aQuVA@mail.gmail.com
[3]
https://www.postgresql.org/message-id/CAMsr+YE6BK4iAaQz=nY3xDnbLhnNZ_4tp-PTJqbNNpsZMgoo8Q@mail.gmail.com

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-03-23 13:49:44 Re: FOR EACH ROW triggers on partitioned tables
Previous Message Robert Haas 2018-03-23 12:56:49 Re: [HACKERS] Add support for tuple routing to foreign partitions