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 1tuGWN-006lpP-EI for pgsql-performance@arkaria.postgresql.org; Mon, 17 Mar 2025 19:53:11 +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 1tuGWL-000tY3-Ia for pgsql-performance@arkaria.postgresql.org; Mon, 17 Mar 2025 19:53:09 +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 1tuGWK-000tXJ-Vp for pgsql-performance@lists.postgresql.org; Mon, 17 Mar 2025 19:53:09 +0000 Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tuGWH-003NVh-30 for pgsql-performance@lists.postgresql.org; Mon, 17 Mar 2025 19:53:07 +0000 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 1FC462540127 for ; Mon, 17 Mar 2025 15:53:04 -0400 (EDT) Received: from phl-imap-15 ([10.202.2.104]) by phl-compute-02.internal (MEProxy); Mon, 17 Mar 2025 15:53:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salomvary.com; h=cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1742241183; x=1742327583; bh=15jFOKOoCm vzSPmx1poy/RfiQoDJXF20pGreCWwWTrs=; b=NERmDWa6g+Y0uWE29hAhzEHb6i 7W7lPxV7kwss+xuX2302bDoBowiKmM/DujyS06bOwO9XJXpcyam9b1O8aCr2fxgD NPURBwE0goQlogev/Fq/sf1zqsKwFyilphYZYjMS4KKUJCgg0FpdIXz6RONxpkc0 lzTchbfcde5WTn9Y/C+o0ko0lKQRwyxUSV6oDMhn4jIO++m668GQbxFOqZajMHk2 30/KInBf474xd+jBaOVTRubMAL2WBHk19M21rfTIvJmYMjNO7+eaAhkiPfT+wjaZ CYVpZMWKP6x/A/1yYe/o4fQa/RE4sR0rC/Of2Uv3XeP+ziPrw+JmnuaF2rxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1742241183; x=1742327583; bh=15jFOKOoCmvzSPmx1poy/RfiQoDJXF20pGr eCWwWTrs=; b=xeUfbVl2ZPoKpt1jOYeV8Qzxcpa3ToiResPi+yRSb852AFf+eLS POe6K8QQVxBRYYb+cn7kDudppouI9vB1Aqd2tvWgfglA67f8Z0L7PioX07CPBBUt diiJIkPQyovjkbadzDXVrzkF37O6cNabk/H7Nv+d/TNgHw+JH/BgyT3zCiLPwNjA 0JrewKg1dLA7cXRRRkoWY94LRRipVUvJ0Dzu06gihXeNH9UBrWt6UBRxBVp6yhNf 5/wczPJpWkrI34Tt9mgPJwzDllyDTw9cEaIc1Vcvbr7Rk/wIm1nAvRPbTjy/aKmL TATre0syyhiLtM4GJoLma4Jkiph/7j0B3dQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugedtgeefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefogg ffhffvkfgjfhfutgesrgdtreerredtjeenucfhrhhomheplhgrrhhgvgdrghhoohhsvgdv kedvleesshgrlhhomhhvrghrhidrtghomhenucggtffrrghtthgvrhhnpedvieeglefhue dtgeeuvdejffeguddufefhieehgfehffekfeekgffgheeigfehffenucffohhmrghinhep tgihsggvrhhtvggtqdhpohhsthhgrhgvshhqlhdrtghomhenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrghgvrdhgohhoshgvvdekvdel sehsrghlohhmvhgrrhihrdgtohhmpdhnsggprhgtphhtthhopedupdhmohguvgepshhmth hpohhuthdprhgtphhtthhopehpghhsqhhlqdhpvghrfhhorhhmrghntggvsehlihhsthhs rdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i35d941ae:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 24DD4780067; Mon, 17 Mar 2025 15:53:03 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 Date: Mon, 17 Mar 2025 20:52:31 +0100 From: large.goose2829@salomvary.com To: pgsql-performance@lists.postgresql.org Message-Id: <8a919391-8510-442b-b020-f9a9f4e80fbb@app.fastmail.com> In-Reply-To: <0bf497361892767b9e46df0928ed6554190ca1de.camel@cybertec.at> References: <0bf497361892767b9e46df0928ed6554190ca1de.camel@cybertec.at> Subject: Re: Efficient pagination using multi-column cursors Content-Type: multipart/alternative; boundary=6809a499245d4536b11ccba43bdc97b2 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6809a499245d4536b11ccba43bdc97b2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Folks, thanks everyone for the valuable inputs, I think I more-or-less u= nderstand now what the options are for my particular problem. On Wed, Feb 26, 2025, at 17:14, Peter Geoghegan wrote: > On Wed, Feb 26, 2025 at 10:40=E2=80=AFAM wrote: > > Does this mean that it is not possible to come up with a plan that h= as the same performance as "WHERE (col_1, col_2, col_3) > (10, 20, 29)" = using "handwritten" filters, or only for "mixed order"? Or not a theoret= ical limitation but a limitation of the current implementation of the qu= ery planner? >=20 > Perhaps the query planner should be taught to rewrite the query in > such a way as to make it unnecessary for you to do so -- I think that > that's what MySQL is doing for you. That is beside the point. Would it make sense to file a feature request for PostgreSQL to implemen= t that MySQL-like optimization mentioned earlier? On Wed, Feb 26, 2025, at 17:15, Laurenz Albe wrote: > Here are my ideas for this situation: >=20 > https://www.cybertec-postgresql.com/en/keyset-pagination-with-descendi= ng-order/ Laurenz, your post is a goldmine of advanced solutions, thanks for shari= ng. Cheers, M=C3=A1rton --6809a499245d4536b11ccba43bdc97b2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable