Re: IMMUTABLE?

From: Joachim Wieland <joe(at)mcknight(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Wheeler <david(at)kineticode(dot)com>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: IMMUTABLE?
Date: 2006-05-16 16:55:14
Message-ID: 20060516165514.GA4424@mcknight.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, May 16, 2006 at 09:33:14AM -0400, Tom Lane wrote:
> Joachim Wieland <joe(at)mcknight(dot)de> writes:
> > So irrespective of caching to prevent evaluation across statements, within a
> > single statement, is there a strong reason why for example in
> > WHERE col = f(const) with f() declared as immutable or stable and without an
> > index on col, f() still gets called for every row? Or is this optimization
> > just not done yet?

> The above statement is not correct, at least not for immutable functions.

So an immutable function gets evaluated once but a stable function still gets
called for every row? Wouldn't it make sense to call a stable function only
once as well?

Joachim

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message David Wheeler 2006-05-16 18:00:27 Re: IMMUTABLE?
Previous Message Jignesh K. Shah 2006-05-16 15:52:58 Re: Pgsql (and mysql) benchmark on T2000/Solaris and some