Re: Constant propagation and similar issues

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jules Bean <jules(at)jellybean(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Constant propagation and similar issues
Date: 2000-09-18 09:34:35
Message-ID: 3.0.5.32.20000918193435.02f8d210@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 |/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Karl F. Larsen 2000-09-18 11:32:19 Re: Cannot compile
Previous Message devik 2000-09-18 09:31:30 WAL & MVCC