Hi,

I was doing EXPLAIN ANALYZE on a query where I compare against
current_date and noticed the following:

   Filter: (date <= ('now'::text)::date)

I knew about now() but did not know about 'now' and have since learnt
of 'today', 'tomorrow', etc.  Great!

So, I changed my condition to <= 'now' to see if there would be any
improvement, which changed the filter line to:

   Filter: (date <= '2009-02-05'::date)

and without fail this query is 2ms quicker every time.  I alternated
between the two and ran them both several times to make sure it wasn't
just a cache difference.

AFAIK current_date is standard and 'now' and 'today', etc are not...
so that's one reason to continuing using current_date.  However, I
wonder why 'today' and current_date don't generate the same query
plan?

Jamie

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

Reply via email to