On Sat, Feb 11, 2012 at 12:42, Jasen Betts <ja...@xnet.co.nz> wrote:
> There is no need. now() is tagged as stable. it will only be executed once.
> the planner will figure this out for you.

Actually that's not always true. In index condition arguments, the
expression would indeed be executed just once. But in filter clauses
(e.g. seq scan), the whole expression is executed once per row, which
is a bit inefficient. Of course this makes no visible difference for
now(), since it always returns the same value -- the transaction start
time.

(I submitted a patch to improve this, but it's not certain whether it
will be included in PostgreSQL 9.2 or not)

Regards,
Marti

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to