Re: [PERFORM] query with timestamp not using index

2004-12-01 Thread Tom Lane
Brian Hirt <[EMAIL PROTECTED]> writes: > select count(*) from redir_log > where redir_timestamp >= '10/14/2004'::timestamp without time zone at time > zone 'GMT'; That seems like the hard way to express a timestamp constant. Why not select count(*) from redir_log where redir_timestamp >= '10/14

Re: [PERFORM] query with timestamp not using index

2004-12-01 Thread Tom Lane
Brian Hirt <[EMAIL PROTECTED]> writes: > it's more like: > declare > foo_date date; > begin > select some_date into foo_date from some_table where something = > something_else; > select blah from redir_log where redir_timestamp >= foo_date::timestamp > without time zone at time

Re: [PERFORM] query with timestamp not using index

2004-12-01 Thread Brian Hirt
On Dec 1, 2004, at 1:06 PM, Tom Lane wrote: That seems like the hard way to express a timestamp constant. Why not I realized after i sent this message that i might get this responese. I should have mentioned this was from within a stored pl/pgsql function, and the date wasn't a constant, but a

Re: [PERFORM] query with timestamp not using index

2004-12-01 Thread Richard Huxton
Brian Hirt wrote: I have a query that fetches information from a log, based on an indexed column. The timestamp in the table is with time zone, and the server time zone is not GMT. However, i want all of the timestamps for a particular day in GMT. If i simply use a date constant, the inde