Re: [HACKERS] Early evaluation of constant expresions (with PATCH) - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Early evaluation of constant expresions (with PATCH)
Date
Msg-id 199909220217.WAA23935@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Early evaluation of constant expresions (with PATCH)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Bernard Frankpitt <frankpit@pop.dn.net> writes:
> > The solution that I propose is to include code in the optimizer that
> > picks functions with constant arguments out of a qualification
> > clause, and evaluates them.
> 
> This is something I had on my own to-do list, and I'm glad to see
> someone beat me to it.  But you've only done half the job: you
> should also be folding operators with constant arguments.
> 
> Also, you need to be wary of functions like now() and random().
> There probably isn't any other way to handle these than to add a
> column to pg_proc flagging functions that can't be constant-folded.

Already there, pg_proc.proiscachable.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Early evaluation of constant expresions (with PATCH)
Next
From: frankpit@pop.dn.net
Date:
Subject: Re: [HACKERS] Early evaluation of constant expresions (with PATCH)