Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGyKE-0006BA-Fp for pgsql-performance@arkaria.postgresql.org; Fri, 21 Feb 2014 22:12:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WGyKE-0007D1-0K for pgsql-performance@arkaria.postgresql.org; Fri, 21 Feb 2014 22:12:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGyKD-0007Cv-8r for pgsql-performance@postgresql.org; Fri, 21 Feb 2014 22:12:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WGyKB-0000te-1W for pgsql-performance@postgresql.org; Fri, 21 Feb 2014 22:12:04 +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 s1LMC1rC019687; Fri, 21 Feb 2014 17:12:01 -0500 From: Tom Lane To: Alexey Klyukin cc: pgsql-performance@postgresql.org Subject: Re: Lack of index usage when doing array casts In-reply-to: <5576.1393009497@sss.pgh.pa.us> References: <5576.1393009497@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 21 Feb 2014 14:04:57 -0500" Date: Fri, 21 Feb 2014 17:12:01 -0500 Message-ID: <19686.1393020721@sss.pgh.pa.us> X-Pg-Spam-Score: -2.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 I wrote: > Hmm. IIRC the text to enum cast is considered stable not immutable, which > is why that doesn't get folded to a Const on sight. However, it seems > like it'd be okay for scalararraysel() to reduce stable expressions for > estimation purposes, ie it should be using estimate_expression_value. I've committed a patch for this; it will be in 9.3.4. 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