Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group