Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kUsSJ-0008Vx-Nc for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Oct 2020 14:17:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kUsRm-0003p6-0X for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Oct 2020 14:17:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kUsRl-0003ou-Qt for pgsql-bugs@lists.postgresql.org; Tue, 20 Oct 2020 14:17:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kUsRj-0001wM-Bp for pgsql-bugs@lists.postgresql.org; Tue, 20 Oct 2020 14:17:05 +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 09KEGuOv604510; Tue, 20 Oct 2020 10:16:57 -0400 From: Tom Lane To: Alvaro Herrera cc: David Christensen , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16676: SELECT ... FETCH FIRST ROW WITH TIES FOR UPDATE SKIP LOCKED locks rows it doesn't return In-reply-to: <20201020134114.GA11045@alvherre.pgsql> References: <20201020134114.GA11045@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 20 Oct 2020 10:41:14 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <604508.1603203416.1@sss.pgh.pa.us> Date: Tue, 20 Oct 2020 10:16:56 -0400 Message-ID: <604509.1603203416@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2020-Oct-19, David Christensen wrote: >> Maybe splitting LockRows into two nodes, one for locking and one for >> emitting unlocked nodes then interleaving Limit in between? (Or only >> doing something along these lines for this admittedly narrow use case.) > I was having a similar idea, but the main reason I don't think it's a > good fix is that we can't backpatch such a change to pg13. Um, why not? I don't have a position yet on whether this is a good way to fix it; but if we did do it, AFAICS the only thing we'd have to be careful of in v13 is not renumbering existing NodeTag values. If your concern is just that EXPLAIN plans will look different, the same could be said of David's other proposal. regards, tom lane