Re: query with timestamp not using index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brian Hirt <bhirt(at)mobygames(dot)com>
Cc: "'Postgresql Performance'" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: query with timestamp not using index
Date: 2004-12-01 20:06:58
Message-ID: 18427.1101931618@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Brian Hirt <bhirt(at)mobygames(dot)com> 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/2004 00:00 GMT';

(FWIW, though, the AT TIME ZONE construct *should* have been collapsed
to a constant; 8.0 fixes this.)

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2004-12-01 20:19:00 Re: [PERFORM] pg_restore taking 4 hours!
Previous Message Richard Huxton 2004-12-01 17:38:28 Re: query with timestamp not using index