X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id ACCC69FA3D7 for ; Sun, 11 Jun 2006 14:48:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 25088-10 for ; Sun, 11 Jun 2006 14:48:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id D66DB9FA5DD for ; Sun, 11 Jun 2006 14:48:39 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id B533456440; Sun, 11 Jun 2006 12:48:38 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Sun, 11 Jun 2006 12:48:37 -0500 Date: Sun, 11 Jun 2006 12:48:37 -0500 From: "Jim C. Nasby" To: "Craig A. James" Cc: pgsql-performance@postgresql.org Subject: Re: function not called if part of aggregate Message-ID: <20060611174837.GF34196@pervasive.com> References: <448C505C.2080504@modgraph-usa.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <448C505C.2080504@modgraph-usa.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060611:cjames@modgraph-usa.com::7wQoMOMi5EHEqHEL:00000000000000 000000000000000000000000EbFA X-Hashcash: 1:20:060611:pgsql-performance@postgresql.org::DqbVMo3oh3kTxj63:00000 0000000000000000000000002ZKB X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/120 X-Sequence-Number: 19477 On Sun, Jun 11, 2006 at 10:18:20AM -0700, Craig A. James wrote: > This doesn't seem right to me -- how can the optimizer possibly know that a > function doesn't have a side effect, as in my case? Functions could do all > sorts of things, such as logging activity, filling in other tables, etc, > etc. > > Am I missing something here? Read about function stability in the docs. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461