Re: query with timestamp not using index

From: Brian Hirt <bhirt(at)mobygames(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "'Postgresql Performance'" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: query with timestamp not using index
Date: 2004-12-01 22:09:04
Message-ID: 9CFDF39A-43E5-11D9-AD0F-000D93AD2E74@mobygames.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


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 variable. I was just
trying to simplify the example.

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 zone 'GMT';
etc / etc / etc
end;

> 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
>
--------------------------------------------
MobyGames
http://www.mobygames.com
The world's largest and most comprehensive 
gaming database project

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-12-01 22:16:53 Re: query with timestamp not using index
Previous Message Josh Berkus 2004-12-01 20:25:42 Re: Using "LIMIT" is much faster even though, searching