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 DF5259F9CAA for ; Thu, 15 Jun 2006 12:59:40 -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 15993-02 for ; Thu, 15 Jun 2006 12:59:31 -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 B0F829FA160 for ; Thu, 15 Jun 2006 12:59:31 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id CA4915647A; Thu, 15 Jun 2006 10:59:30 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Thu, 15 Jun 2006 10:59:29 -0500 Date: Thu, 15 Jun 2006 10:59:29 -0500 From: "Jim C. Nasby" To: Zoltan Boszormenyi Cc: Volkan YAZICI , pgsql-performance@postgresql.org Subject: Re: Precomputed constants? Message-ID: <20060615155929.GL34196@pervasive.com> References: <3167.213.163.11.81.1150282434.squirrel@www.dunaweb.hu> <20060614110713.GA2277@alamut.tdm.local> <3861.213.163.11.81.1150284610.squirrel@www.dunaweb.hu> <20060614151804.GB34196@pervasive.com> <4490E286.90004@dunaweb.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4490E286.90004@dunaweb.hu> 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:060615:zboszor@dunaweb.hu::sl6sib0Tto5qFgf8:0000000000000000000 0000000000000000000000004Z+R X-Hashcash: 1:20:060615:yazicivo@ttnet.net.tr::9tMy5O751ZtoAoT/:0000000000000000 0000000000000000000000001KzZ X-Hashcash: 1:20:060615:pgsql-performance@postgresql.org::27X7pg5EEE3Cob6f:00000 0000000000000000000000004KrU X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/309 X-Sequence-Number: 19666 On Thu, Jun 15, 2006 at 06:31:02AM +0200, Zoltan Boszormenyi wrote: > Jim C. Nasby ?rta: > >On Wed, Jun 14, 2006 at 01:30:10PM +0200, B?sz?rm?nyi Zolt?n wrote: > > > >>Replacing random() with a true constant gives me index scan > >>even if it's hidden inside other function calls. E.g.: > >> > > > >The database has no choice but to compute random() for every row; it's > >marked VOLATILE. > > > > I see now, docs about CREATE FUNCTION mentions random(), > currval() and timeofday() as examples for VOLATILE. > But where in the documentation can I find this info about all > built-in functions? Thanks. No, but you can query pg_proc for that info. The docs should have info about that table. -- 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