Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tUsjG-003WsA-8k for pgsql-general@arkaria.postgresql.org; Mon, 06 Jan 2025 19:25:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tUsjF-00Bag6-Mv for pgsql-general@arkaria.postgresql.org; Mon, 06 Jan 2025 19:25:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tUsjF-00Bafy-CP for pgsql-general@lists.postgresql.org; Mon, 06 Jan 2025 19:25:33 +0000 Received: from dverite2024.planet-service.net ([185.16.44.252] helo=mail.verite.pro) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tUsjC-000DBk-0I for pgsql-general@lists.postgresql.org; Mon, 06 Jan 2025 19:25:32 +0000 Received: by mail.verite.pro (Postfix, from userid 1000) id DF7C22C603B; Mon, 6 Jan 2025 20:25:28 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "Daniel Verite" Subject: Re: Will PQsetSingleRowMode get me results faster? To: "Stijn Sanders" Cc: pgsql-general@lists.postgresql.org In-Reply-To: Date: Mon, 06 Jan 2025 20:25:26 +0100 Message-Id: <140214eb-a8ce-4285-afdd-7770c5a9d274@manitou-mail.org> X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Stijn Sanders wrote: > From what I notice using LibPQ, it appears a query needs to complete > before resulting data is being transferred to the client. Please > correct me if I'm wrong. No, the query does not need to complete. If you run something like "select * from bigtable" in single-row or chunked mode, you should see that the first results are typically available immediately to the application, while the query is far from finished. But it depends on the query plan. A lot of queries cannot produce any result until the final stage of their execution. For these, you can't expect any difference in how fast the first results are available client-side. Best regards, --=20 Daniel V=E9rit=E9 https://postgresql.verite.pro/ Twitter: @DanielVerite