Re: Constant propagation and similar issues - Mailing list pgsql-hackers

From Philip Warner
Subject Re: Constant propagation and similar issues
Date
Msg-id 3.0.5.32.20000918193435.02f8d210@mail.rhyme.com.au
Whole thread Raw
In response to Re: Constant propagation and similar issues  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
At 19:05 18/09/00 +1000, Philip Warner wrote:
>
>I guess an alternative would be to define a special 'iscacheable' function:
>eg.
>
>   function constant(arg <all-types>) returns <same-type-as-arg>
>
>so we could have:
>
>    field < constant(current_timestamp - interval '1 hour')
>
>although this looks suspiciously like an optimizer hint which I think
>people have been opposed to in the past...
>

I just saw the flaw with this: iscacheable is not enough when the args are
deemed non-constant. I guess we'd need some kind of 'evaluate_once' flag,
which is getting a little obtuse.

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


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: Constant propagation and similar issues
Next
From: Peter Eisentraut
Date:
Subject: Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?