Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eiMKQ-0007E7-Sv for pgsql-performance@arkaria.postgresql.org; Sun, 04 Feb 2018 15:35:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiMKP-0004DK-QO for pgsql-performance@arkaria.postgresql.org; Sun, 04 Feb 2018 15:35:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eiMKP-0004DA-GI for pgsql-performance@lists.postgresql.org; Sun, 04 Feb 2018 15:35:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eiMKN-0001so-3k for pgsql-performance@postgresql.org; Sun, 04 Feb 2018 15:35:36 +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 w14FZW5f015451; Sun, 4 Feb 2018 10:35:32 -0500 From: Tom Lane To: Rick Otten cc: Mariel Cherkassky , PostgreSQL mailing lists Subject: Re: postgresql 10.1 wrong plan in when using partitions bug In-reply-to: References: Comments: In-reply-to Rick Otten message dated "Sun, 04 Feb 2018 07:15:24 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15449.1517758532.1@sss.pgh.pa.us> Date: Sun, 04 Feb 2018 10:35:32 -0500 Message-ID: <15450.1517758532@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Rick Otten writes: > I'm wrestling with a very similar problem too - except instead of official > partitions I have a views on top of a bunch (50+) of unioned materialized > views, each "partition" with 10M - 100M rows. On 9.6.6 the queries would > use the indexes on each materialized view. On 10.1, every materialized > view is sequence scanned. Can you post a self-contained example of this behavior? My gut reaction is that the changes for the partitioning feature broke some optimization that used to work ... but it could easily be something else, too. Hard to say with nothing concrete to look at. > I'm mostly hoping with fingers crossed that something in 10.2, which is > coming out next week, fixes it. If you'd reported this in suitable detail awhile ago, we might have been able to fix it for 10.2. At this point, with barely 30 hours remaining before the planned release wrap, it's unlikely that anything but the most trivial fixes could get done in time. regards, tom lane