Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XeIWZ-0000qC-HZ for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Oct 2014 06:57:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XeIWX-00084I-Me for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Oct 2014 06:57:29 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XeIWW-000844-Vz for pgsql-bugs@postgresql.org; Wed, 15 Oct 2014 06:57:29 +0000 Received: from sam.nabble.com ([216.139.236.26]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XeIWT-0001Lm-Ue for pgsql-bugs@postgresql.org; Wed, 15 Oct 2014 06:57:26 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1XeIWS-0002Va-Ng for pgsql-bugs@postgresql.org; Tue, 14 Oct 2014 23:57:24 -0700 Date: Tue, 14 Oct 2014 23:57:24 -0700 (PDT) From: David G Johnston To: pgsql-bugs@postgresql.org Message-ID: <1413356244696-5823070.post@n5.nabble.com> In-Reply-To: <11263.1413312030@sss.pgh.pa.us> References: <20141014091221.25461.16786@wrigleys.postgresql.org> <11263.1413312030@sss.pgh.pa.us> Subject: Re: BUG #11671: UNACCENT call with constant arg evaluated for each row MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Tom Lane-2 wrote > t.chaumeny@ > writes: >> Since UNACCENT function > > [...] than naive SQL [...] Was that intentional... ;) Given the planner knows its safe, and has to do a sequential scan and so evaluate the expression many times, the question becomes why then doesn't it choose that which is, in reality, the faster plan? Reading 9.3@35.6 http://www.postgresql.org/docs/9.3/static/xfunc-volatility.html I take it had the plan used an index instead of a sequential scan the optimization would have occurred... David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11671-UNACCENT-call-with-constant-arg-evaluated-for-each-row-tp5823010p5823070.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs