pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
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 09:55:06 -0400
Message-ID: <20200629135506.GX3125@tamriel.snowman.net> (raw)
In-Reply-To: <CAHkN8V_s+KmSr3gH4YaGrKWJZRRHWKXS6ZjYBUYG1RLE21eLjQ@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>

Greetings,

* Samuel Williams (space.ship.traveller@gmail.com) wrote:
> Here is a short example:
> 
> https://gist.github.com/ioquatix/2f08f78699418f65971035785c80cf18
> 
> It makes 10 queries in one "PQsendQuery" and sets single row mode. But
> all the results come back at once as shown by the timestamps.

If you have 10 queries that you want to make in a given transaction and
you care about the latency then really the best option is to wrap that
all in a single pl/pgsql function on the server side and make one call.

> Next I'm planning to investigate streaming large recordsets to see if
> it works better/incrementally.

If you want to stream large data sets to/from PG, you should consider
using COPY.

Thanks,

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (14+ messages)  latest in thread

Message-ID: <20200629135506.GX3125@tamriel.snowman.net>
Permalink:  ../20200629135506.GX3125@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20200629135506.GX3125@tamriel.snowman.net

 · 

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: sfrost@snowman.net, space.ship.traveller@gmail.com, david.g.johnston@gmail.com
  Subject: Re: libpq pipelineing
  In-Reply-To: <20200629135506.GX3125@tamriel.snowman.net>
  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> <20200629135506.GX3125@tamriel.snowman.net>

* 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