Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1htCEy-0004Be-CQ for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Aug 2019 14:39:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1htCEx-0005BC-3K for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Aug 2019 14:39:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1htCCf-0000M6-9j for pgsql-hackers@lists.postgresql.org; Thu, 01 Aug 2019 14:37:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1htCCc-0007Ef-RF for pgsql-hackers@lists.postgresql.org; Thu, 01 Aug 2019 14:37:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x71Eb6jq012612; Thu, 1 Aug 2019 10:37:06 -0400 From: Tom Lane To: Julien Rouhaud cc: Thomas Munro , Marc Cousin , Alexander Korotkov , Tomas Vondra , Nikita Glukhov , PostgreSQL Hackers Subject: Re: Avoid full GIN index scan when possible In-reply-to: References: <20190628161051.szk2kxmue6yjdmra@development> <4547.1561748599@sss.pgh.pa.us> <20190628195401.frwhcga76rrytbc4@development> <7773.1561752983@sss.pgh.pa.us> <27217.1564507668@sss.pgh.pa.us> Comments: In-reply-to Julien Rouhaud message dated "Thu, 01 Aug 2019 12:13:24 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12610.1564670226.1@sss.pgh.pa.us> Date: Thu, 01 Aug 2019 10:37:06 -0400 Message-ID: <12611.1564670226@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Julien Rouhaud writes: > Attached v4 that should address all comments. Eyeing this a bit further ... doesn't scanPendingInsert also need to honor so->forcedRecheck? Something along the lines of - tbm_add_tuples(tbm, &pos.item, 1, recheck); + tbm_add_tuples(tbm, &pos.item, 1, recheck | so->forcedRecheck); at line 1837? (Obviously, there's more than one way you could write that.) I'm also not exactly satisfied with the new comments --- they aren't conveying much, and the XXX in one of them is confusing; does that mean you're unsure that the comment is correct? The added test case seems a bit unsatisfying as well, in that it fails to retrieve any rows. It's not very clear what it's trying to test. regards, tom lane