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 1rrhL7-0026m4-G5 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2024 16:50:26 +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 1rrhL6-00A4fi-9e for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2024 16:50:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrhL5-00A4fa-W7 for pgsql-hackers@lists.postgresql.org; Tue, 02 Apr 2024 16:50:23 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrhL3-000DSZ-7f for pgsql-hackers@postgresql.org; Tue, 02 Apr 2024 16:50:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 432GoEib1655991; Tue, 2 Apr 2024 12:50:14 -0400 From: Tom Lane To: "Daniel Verite" cc: Laurenz Albe , PostgreSQL Hackers , Robert Haas , Jakub Wartak Subject: Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs In-reply-to: <57a408d0-4c64-4bf2-ad20-9b459afeda33@manitou-mail.org> References: <57a408d0-4c64-4bf2-ad20-9b459afeda33@manitou-mail.org> Comments: In-reply-to "Daniel Verite" message dated "Mon, 01 Apr 2024 19:52:42 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1655989.1712076614.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 02 Apr 2024 12:50:14 -0400 Message-ID: <1655990.1712076614@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Daniel Verite" writes: > Updated patches are attached. I started to look through this, and almost immediately noted - - Retrieving Query Results Row-by-Row + + Retrieving Query Results in chunks This is a bit problematic, because changing the sect1 ID will change the page's URL, eg https://www.postgresql.org/docs/current/libpq-single-row-mode.html Aside from possibly breaking people's bookmarks, I'm pretty sure this will cause the web docs framework to not recognize any cross-version commonality of the page. How ugly would it be if we left the ID alone? Another idea could be to leave the whole page alone and add a new for chunked mode. But ... TBH I'm not convinced that we need the chunked mode at all. We explicitly rejected that idea back when single-row mode was designed, see around here: https://www.postgresql.org/message-id/flat/50173BF7.1070801%40Yahoo.com#7f= 92ebad0143fb5f575ecb3913c5ce88 and I'm still very skeptical that there's much win to be had. I do not buy that psql's FETCH_COUNT mode is a sufficient reason to add it. FETCH_COUNT mode is not something you'd use non-interactively, and there is enough overhead elsewhere in psql (notably in result-set formatting) that it doesn't seem worth micro-optimizing the part about fetching from libpq. (I see that there was some discussion in that old thread about micro-optimizing single-row mode internally to libpq by making PGresult creation cheaper, which I don't think anyone ever got back to doing. Maybe we should resurrect that.) regards, tom lane