Re: [BUGS] BUG #5293: constant function (date_trunc) is repeatedly evaluated inside loop

2010-01-20 Thread Richard Neill
Kevin Grittner wrote: "Richard Neill" wrote: date_trunc('day', timestamp '2010-01-20 10:16:55') What happens with a "timestamp with time zone" literal? -Kevin Good call! This query is fast: SELECT count(1) FROM tbl_tracker WHERE ((srep_timestamp >= date_trunc('day', timestamp wi

Re: [BUGS] BUG #5293: constant function (date_trunc) is repeatedly evaluated inside loop

2010-01-20 Thread Kevin Grittner
Richard Neill wrote: > #fast > WHERE column < '2010-010-20 00:00:00' > > #fast > WHERE column < date_trunc('day', timestamp with time zone > '2010-01-20 10:16:55') > > #slow > WHERE column < date_trunc('day', timestamp > '2010-01-2

Re: [BUGS] BUG #5293: constant function (date_trunc) is repeatedly evaluated inside loop

2010-01-20 Thread Kevin Grittner
"Richard Neill" wrote: > date_trunc('day', timestamp '2010-01-20 10:16:55') What happens with a "timestamp with time zone" literal? -Kevin -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs

[BUGS] BUG #5293: constant function (date_trunc) is repeatedly evaluated inside loop

2010-01-20 Thread Richard Neill
The following bug has been logged online: Bug reference: 5293 Logged by: Richard Neill Email address: rn...@cam.ac.uk PostgreSQL version: 8.4.2 Operating system: Linux Description:constant function (date_trunc) is repeatedly evaluated inside loop Details: SUMMARY --