Re: Calculated view fields (8.1 != 8.2)

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: pgsql-hackers(at)postgreSQL(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Calculated view fields (8.1 != 8.2)
Date: 2007-03-08 18:35:31
Message-ID: 45F05773.6000607@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Gaetano Mendola <mendola(at)bigfoot(dot)com> writes:
>> [ 8.2 evaluates volatile functions in the targetlist of a view ]
>> If I mark the function as STABLE or IMMUTABLE then even with version
>> 8.2 the function is not evaluated. Is this the intended behavior?
>
> Yes; people complained that we needed to be more careful about the
> number of times volatile functions get evaluated.

I suspect that functions are evaluated also for record discarded due to
joins. Is that the case?

Like:

SELECT * FROM ta JOIN tb USING (id) where tb.foo = 4;

If ta is a view with some calculated fields are the function on ta
evaluated only for record matching the filters or in some case (
like a full scan on ta ) also for the records discarded due to the join?

Regards
Gaetano Mendola

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-03-08 18:44:10 Re: RFC: changing autovacuum_naptime semantics
Previous Message Simon Riggs 2007-03-08 18:34:27 Re: [PATCHES] pg_standby