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 15B469FA5BE for ; Thu, 15 Jun 2006 15:19:24 -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 34856-01 for ; Thu, 15 Jun 2006 15:19:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from linux.dunaweb.hu (linux.dunaweb.hu [62.77.196.1]) by postgresql.org (Postfix) with ESMTP id D57EB9FA13E for ; Thu, 15 Jun 2006 15:19:18 -0300 (ADT) Received: from localhost (linux.dunaweb.hu [127.0.0.1]) by linux.dunaweb.hu (Postfix) with ESMTP id 634388E06BA; Thu, 15 Jun 2006 20:19:16 +0200 (CEST) Received: from linux.dunaweb.hu ([127.0.0.1]) by localhost (linux.dunaweb.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22111-01; Thu, 15 Jun 2006 20:19:12 +0200 (CEST) Received: from [81.17.177.202] (host-81-17-177-202.dunaweb.hu [81.17.177.202]) by linux.dunaweb.hu (Postfix) with ESMTP id B4F308E0AEC; Thu, 15 Jun 2006 20:19:12 +0200 (CEST) Message-ID: <4491A49E.5010105@dunaweb.hu> Date: Thu, 15 Jun 2006 20:19:10 +0200 From: Zoltan Boszormenyi User-Agent: Thunderbird 1.5.0.2 (X11/20060501) MIME-Version: 1.0 To: "Jim C. Nasby" Cc: Volkan YAZICI , pgsql-performance@postgresql.org Subject: Re: Precomputed constants? 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> <20060615155929.GL34196@pervasive.com> In-Reply-To: <20060615155929.GL34196@pervasive.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: amavisd-new at dunaweb.hu X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/320 X-Sequence-Number: 19677 Jim C. Nasby írta: > 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. > Thanks! # select proname,provolatile from pg_proc where proname='random'; proname | provolatile ---------+------------- random | v (1 sor) # select distinct provolatile from pg_proc; provolatile ------------- i s v (3 sor) If I get this right, IMMUTABLE/STABLE/VOLATILE are indicated with their initials. Best regards, Zoltán Böszörményi