Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YvSOU-00063I-Nj for pgsql-performance@arkaria.postgresql.org; Thu, 21 May 2015 15:28:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YvSOU-0000as-3U for pgsql-performance@arkaria.postgresql.org; Thu, 21 May 2015 15:28:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YvSOT-0000ak-A8 for pgsql-performance@postgresql.org; Thu, 21 May 2015 15:28:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1YvSOQ-0007PT-JP for pgsql-performance@postgresql.org; Thu, 21 May 2015 15:28:20 +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 t4LFSGcR027277; Thu, 21 May 2015 11:28:17 -0400 From: Tom Lane To: Florian Lohoff cc: pgsql-performance@postgresql.org Subject: Re: union all and filter / index scan -> seq scan In-reply-to: <20150521104103.GB10049@pax.zz.de> References: <20150521104103.GB10049@pax.zz.de> Comments: In-reply-to Florian Lohoff message dated "Thu, 21 May 2015 12:41:03 +0200" Date: Thu, 21 May 2015 11:28:16 -0400 Message-ID: <27276.1432222096@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Florian Lohoff writes: > It seems the planner is not able to rewrite a union all I do not see any problems with pushing indexable conditions down through a UNION ALL when I try it. I speculate that either you are using a very old 9.1.x minor release, or the actual view is more complex than you've let on. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance