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 1jvT41-0007cq-DK for pgsql-general@arkaria.postgresql.org; Tue, 14 Jul 2020 22:06:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jvT3z-0001c6-VK for pgsql-general@arkaria.postgresql.org; Tue, 14 Jul 2020 22:06:11 +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 1jvT3z-0001bz-Nf for pgsql-general@lists.postgresql.org; Tue, 14 Jul 2020 22:06:11 +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 1jvT3w-0004nE-V5 for pgsql-general@postgresql.org; Tue, 14 Jul 2020 22:06:11 +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 06EM64Lq2980742; Tue, 14 Jul 2020 18:06:04 -0400 From: Tom Lane To: Radoslav Nedyalkov cc: Michael Lewis , pgsql-general Subject: Re: single table - fighting a seq scan In-reply-to: References: Comments: In-reply-to Radoslav Nedyalkov message dated "Tue, 14 Jul 2020 23:04:11 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2980740.1594764364.1@sss.pgh.pa.us> Date: Tue, 14 Jul 2020 18:06:04 -0400 Message-ID: <2980741.1594764364@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Radoslav Nedyalkov writes: > Ah, I could have messed up the examples I gave. Row numbers are different. > Once again the plans , sorry about that. Given that it works at 100 entries and not 101, I can't escape the suspicion that you're being burnt by predtest.c's MAX_SAOP_ARRAY_SIZE limit. However, that only affects the planner's willingness to make constraint proofs involving the large IN clause, and nothing you've mentioned here explains why such a proof would be needed. Is there something you're not telling us about this table's schema? (I'm wondering if the index is partial, for instance, though one would think that the CTE form of the query wouldn't work either if so.) regards, tom lane