Re: Precomputed constants?

From: Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Precomputed constants?
Date: 2006-06-15 18:19:10
Message-ID: 4491A49E.5010105@dunaweb.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Lewis 2006-06-15 18:33:45 Re: Optimizer internals
Previous Message John Vincent 2006-06-15 18:05:46 Optimizer internals