Re: Constraint exclusion can't process simple constant expressions?

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Constraint exclusion can't process simple constant expressions?
Date: 2011-04-21 07:34:47
Message-ID: BANLkTikLgvy7fVo-_d9iHmW2X4hS3SYztw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Apr 21, 2011 at 9:30 AM, Claudio Freire <klaussfreire(at)gmail(dot)com> wrote:
> On Thu, Apr 21, 2011 at 4:05 AM, Brendan Jurd <direvus(at)gmail(dot)com> wrote:
>>
>> "IMMUTABLE indicates that the function cannot modify the database and
>> always returns the same result when given the same argument values"
>>
>> Emphasis on "always".  If the result of the function, given the same
>> argument values, can be different after a SET, then it doesn't qualify
>> for immutability.  At least, that's my understanding.
>
> That's a ridiculous use of the word "Immutable"
>
> In any CS class, the timezone would be an implicit input to the
> function. So it would be immutable in *that* sense (it also takes
> timezone into consideration).
>
> Perhaps the optimizer should take contextual information that cannot
> change inside a query as input too.
>

In any case, the point is that the CE check (which is what CE cares
about) is indeed immutable in the PG sense.

If it is instantiated with a STABLE expression, it would still be
equivalent to IMMUTABLE within the transaction - which is what CE
cares about.

Am I missing something?

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Laurent Laborde 2011-04-21 08:02:07 Re: postgresql random io test with 2 SSD Kingston V+100 500GB in (software) Raid1
Previous Message Claudio Freire 2011-04-21 07:30:36 Re: Constraint exclusion can't process simple constant expressions?