Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs - Mailing list pgsql-hackers

From Robert Haas
Subject Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs
Date
Msg-id CA+TgmoY+dtzL-AxgdjaZ7HS=AXr1Sd6w-ZCg9uCjW9dvoDZPrQ@mail.gmail.com
Whole thread Raw
In response to Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs
List pgsql-hackers
On Wed, Jan 4, 2023 at 10:22 AM Daniel Verite <daniel@manitou-mail.org> wrote:
> A solution would be for psql to use PQsetSingleRowMode() to retrieve
> results row-by-row, as opposed to using a cursor, and then allocate
> memory for only FETCH_COUNT rows at a time. Incidentally it solves
> other problems like queries containing multiple statements, that also
> fail to work properly with cursors, or UPDATE/INSERT... RETURNING.. on
> large number of rows that could also benefit from pagination in
> memory.

Is there any reason that someone hasn't, like, already done this?

Because if there isn't, we should really do this. And if there is,
like say that it would hurt performance or something, then we should
come up with a fix for that problem and then do something like this.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Ankit Kumar Pandey
Date:
Subject: Re: Todo: Teach planner to evaluate multiple windows in the optimal order
Next
From: Tom Lane
Date:
Subject: Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs