From: Joachim Wieland <joe@mcknight.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Wheeler <david@kineticode.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: IMMUTABLE?
Date: Tue, 16 May 2006 18:55:14 +0200
Message-ID: <20060516165514.GA4424@mcknight.de> (raw)
In-Reply-To: <11508.1147786394@sss.pgh.pa.us>
References: <2D4C0FA5-DB75-45EA-91D2-7B4F6DD55083@kineticode.com>
<5211.1147749711@sss.pgh.pa.us>
<3F0CF576-8C6F-433C-9942-BB36F4E1A194@kineticode.com>
<5894.1147753901@sss.pgh.pa.us>
<20060516094824.GA2376@mcknight.de>
<11508.1147786394@sss.pgh.pa.us>
On Tue, May 16, 2006 at 09:33:14AM -0400, Tom Lane wrote:
> Joachim Wieland <joe@mcknight.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
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: joe@mcknight.de, tgl@sss.pgh.pa.us, david@kineticode.com
Subject: Re: IMMUTABLE?
In-Reply-To: <20060516165514.GA4424@mcknight.de>
* 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