Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpuFb-0003fQ-HJ for pgsql-general@arkaria.postgresql.org; Mon, 29 Jun 2020 13:55:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jpuFa-0001GG-AO for pgsql-general@arkaria.postgresql.org; Mon, 29 Jun 2020 13:55:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpuFa-0001Eo-1p for pgsql-general@lists.postgresql.org; Mon, 29 Jun 2020 13:55:10 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jpuFX-00053K-IJ for pgsql-general@postgresql.org; Mon, 29 Jun 2020 13:55:09 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 0AB7C5F7A5; Mon, 29 Jun 2020 09:55:06 -0400 (EDT) Date: Mon, 29 Jun 2020 09:55:06 -0400 From: Stephen Frost To: Samuel Williams Cc: "David G. Johnston" , pgsql-general Subject: Re: libpq pipelineing Message-ID: <20200629135506.GX3125@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FhvelBhrd33NvMcY" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --FhvelBhrd33NvMcY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Samuel Williams (space.ship.traveller@gmail.com) wrote: > Here is a short example: >=20 > https://gist.github.com/ioquatix/2f08f78699418f65971035785c80cf18 >=20 > 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 --FhvelBhrd33NvMcY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJe+fK6AAoJEO1sijiDR2RVGNoP/jMjkoDz1clriXpD4IEylr+8 avpDBBQtWrRB4rBOHN0SXRqQK6X4XSVwb0704uWXywtjbc4+m4h4drL80qnx+8Ar CL0qSKfitdp7/Jv0pcNAFBrg3JldmqOWh2koC+sMG554AZdZERAMgy5ujCmbL35x ph9lzaAazKvD2goKsDMGhniv1iT+JO27uIDDAijhTrdhFhsW1sNl7uryd0EZ0dbe Y6DVpbSqw/CpegvOAUmseqL189f1Suf347oPuBMwhDzkmUuI7BL1QaUPagEWJ9Yg ERiJfvrjgoL0CNi7pNYo2C4Z1LL76plbZDUffVcBe79QVjhw9zqjHdKTH3FCVvDw 3SeB2q24bqJsPq8VF3Sevq+iwisqTqX/0owl3M5N+Oq2rMPj9R6hoXVUE/gyGFKE h4iAdYxgtdlkQd1XlPnNnveBwxjVj7C5YHVwY7NvdVoVjbIIriRDU2/CMIZH2y9T USI6FPDHMey3nX75RT8QhIB9Zvjbkafzo/sQfwRFE4aFBlWX/dJDsF/gpi8E2Okk iQW81aeXTgV98gXAmVxni9cJHu6T/PsTGoTmGRbs1L4fcscubzpx/1WeU/t2ZxNm AGaJbSTz1NAjsvHsy3CF6tZsqppZr0W3l+yCxXLFHnC5jdnDz1suA2SNIO8erzlE 8xo634V1bQ4Hcae/O3XL =f3hO -----END PGP SIGNATURE----- --FhvelBhrd33NvMcY--