pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Samuel Williams <space.ship.traveller@gmail.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: libpq pipelineing
Date: Mon, 29 Jun 2020 10:06:00 -0400
Message-ID: <322743.1593439560@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHkN8V_FgaXz+E_+Geaxw-Jv4_g9c2P-bxkNqPGysYYu=XOgMg@mail.gmail.com>
References: <CAHkN8V9fUtbcRA1wgSUFbPAPRZyLAN8Ps=iofvVs-9ATsGrB-Q@mail.gmail.com>
	<CAKFQuwZtD7Ne6ANiOgCa40YhPBEhDcDMo8nK8TuR3LKUxbjnjA@mail.gmail.com>
	<CAHkN8V-UKjv0z6Qr_Wf9hWmGy1uk2a1DLp5jjrjqMvY1GF18uA@mail.gmail.com>
	<CAKFQuwaHGskQbx0RfARhDAmSLhZ6FmxD=5AG-1A0hT8n0tSRCA@mail.gmail.com>
	<CAHkN8V-hVUESfNOgkT8WCcJfn_Ce-imasiAcVs0uePVkK=RMNw@mail.gmail.com>
	<CAKFQuwYV7fx9iGNc5JDNnmEY7pOqXpqxgGx70_vvmBC0tJvfLw@mail.gmail.com>
	<CAHkN8V_s+KmSr3gH4YaGrKWJZRRHWKXS6ZjYBUYG1RLE21eLjQ@mail.gmail.com>
	<70948.1593268822@sss.pgh.pa.us>
	<CAHkN8V_FgaXz+E_+Geaxw-Jv4_g9c2P-bxkNqPGysYYu=XOgMg@mail.gmail.com>

Samuel Williams <space.ship.traveller@gmail.com> writes:
> Those methods don't seem to have an equivalent in libpq - you can use
> PQgetResult but it buffers all the rows. Using single row mode results
> in many results for each query (seems like a big overhead).

Have you got any actual evidence for that?  Sure, the overhead is
more than zero, but does it mean anything in comparison to the other
costs of data transmission?

> Maybe the statement about efficiency is incorrect, but it would be
> nice if you could incrementally stream a single result set more
> easily.

More easily than what?  If we did not construct a PGresult then we would
need some other abstraction for access to the returned row, dealing with
error cases, etc etc.  That would mean a lot of very duplicative API code
in libpq, and a painful bunch of adjustments in client code.

			regards, tom lane





view thread (14+ messages)  latest in thread

Message-ID: <322743.1593439560@sss.pgh.pa.us>
Permalink:  ../322743.1593439560@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/322743.1593439560@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, space.ship.traveller@gmail.com, david.g.johnston@gmail.com
  Subject: Re: libpq pipelineing
  In-Reply-To: <322743.1593439560@sss.pgh.pa.us>
  References: <CAHkN8V9fUtbcRA1wgSUFbPAPRZyLAN8Ps=iofvVs-9ATsGrB-Q@mail.gmail.com> <CAKFQuwZtD7Ne6ANiOgCa40YhPBEhDcDMo8nK8TuR3LKUxbjnjA@mail.gmail.com> <CAHkN8V-UKjv0z6Qr_Wf9hWmGy1uk2a1DLp5jjrjqMvY1GF18uA@mail.gmail.com> <CAKFQuwaHGskQbx0RfARhDAmSLhZ6FmxD=5AG-1A0hT8n0tSRCA@mail.gmail.com> <CAHkN8V-hVUESfNOgkT8WCcJfn_Ce-imasiAcVs0uePVkK=RMNw@mail.gmail.com> <CAKFQuwYV7fx9iGNc5JDNnmEY7pOqXpqxgGx70_vvmBC0tJvfLw@mail.gmail.com> <CAHkN8V_s+KmSr3gH4YaGrKWJZRRHWKXS6ZjYBUYG1RLE21eLjQ@mail.gmail.com> <70948.1593268822@sss.pgh.pa.us> <CAHkN8V_FgaXz+E_+Geaxw-Jv4_g9c2P-bxkNqPGysYYu=XOgMg@mail.gmail.com> <322743.1593439560@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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