Re: STABLE functions

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Joachim Wieland <jwieland(at)kawo2(dot)rwth-aachen(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: STABLE functions
Date: 2003-04-27 01:53:27
Message-ID: 5.1.0.14.0.20030427115157.02a599d8@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 11:13 AM 25/04/2003 -0400, Tom Lane wrote:
>The point is that the system *may* choose to evaluate f() only once,
>not that it *must* do so. The classification exists to make it valid
>to use an indexscan on "col".

So just for my own understanding, the optimizer does not know that it can
treat a STABLE function f as constant inside an outer loop of t1 in this query:

select * from t1,t2 where t2.f1 = f(t1.f1)

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2003-04-27 02:49:14 current breakage with PGCLIENTENCODING
Previous Message Joe Conway 2003-04-27 01:10:11 Re: conflicting libraries at runtime