Re: Will PQsetSingleRowMode get me results faster?

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Stijn Sanders" <stijnsanders(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Will PQsetSingleRowMode get me results faster?
Date: 2025-01-06 19:25:26
Message-ID: 140214eb-a8ce-4285-afdd-7770c5a9d274@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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,
--
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2025-01-06 19:47:38 Re: Pipeline Mode vs Single Row Mode / Chunked Rows Mode
Previous Message Adrian Klaver 2025-01-06 16:47:55 Re: Questions about the Debian Package version of pgAdmin