pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zoltan Boszormenyi <zboszor@dunaweb.hu>
To: Jim C. Nasby <jnasby@pervasive.com>
Cc: Volkan YAZICI <yazicivo@ttnet.net.tr>
Cc: pgsql-performance@postgresql.org
Subject: Re: Precomputed constants?
Date: Thu, 15 Jun 2006 20:19:10 +0200
Message-ID: <4491A49E.5010105@dunaweb.hu> (raw)
In-Reply-To: <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>
	<20060615155929.GL34196@pervasive.com>

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




view thread (8+ messages)  latest in thread

Message-ID: <4491A49E.5010105@dunaweb.hu>
Permalink:  ../4491A49E.5010105@dunaweb.hu/
Also on:    postgresql.org/message-id/4491A49E.5010105@dunaweb.hu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: zboszor@dunaweb.hu, jnasby@pervasive.com, yazicivo@ttnet.net.tr
  Subject: Re: Precomputed constants?
  In-Reply-To: <4491A49E.5010105@dunaweb.hu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox