Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs

From: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Verite <daniel(at)manitou-mail(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs
Date: 2023-01-10 12:23:19
Message-ID: CAKZiRmyDoVYa3d4yM-U7h7iX+CghHzHN6x-skM4mALR4EYJFMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 4, 2023 at 6:38 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Wed, Jan 4, 2023 at 11:36 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > As you well know, psql's FETCH_COUNT mechanism is far older than
> > single-row mode. I don't think anyone's tried to transpose it
> > onto that. I agree that it seems like a good idea to try.
> > There will be more per-row overhead, but the increase in flexibility
> > is likely to justify that.
>
> Yeah, I was vaguely worried that there might be more per-row overhead,
> not that I know a lot about this topic. I wonder if there's a way to
> mitigate that. I'm a bit suspicious that what we want here is really
> more of an incremental mode than a single-row mode i.e. yeah, you want
> to fetch rows without materializing the whole result, but maybe not in
> batches of exactly size one.

Given the low importance and very low priority of this, how about
adding it as a TODO wiki item then and maybe adding just some warning
instead? I've intentionally avoided parsing grammar and regexp so it's
not perfect (not that I do care about this too much either, as web
crawlers already have indexed this $thread). BTW I've found two
threads if know what are you looking for [1][2]

-Jakub Wartak.

[1] - https://www.postgresql.org/message-id/flat/a0a854b6-563c-4a11-bf1c-d6c6f924004d%40manitou-mail.org
[2] - https://www.postgresql.org/message-id/flat/1274761885.4261.233.camel%40minidragon

Attachment Content-Type Size
0001-psql-warn-about-CTE-queries-to-be-executed-without-u.patch application/octet-stream 859 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2023-01-10 12:24:18 Re: [PATCH]Feature improvement for MERGE tab completion
Previous Message Nazir Bilal Yavuz 2023-01-10 12:20:18 Use windows VMs instead of windows containers on the CI