From: Brian Hirt <bhirt@mobygames.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: 'Postgresql Performance' <pgsql-performance@postgresql.org>
Subject: Re: query with timestamp not using index
Date: Wed, 1 Dec 2004 15:09:04 -0700
Message-ID: <9CFDF39A-43E5-11D9-AD0F-000D93AD2E74@mobygames.com> (raw)
In-Reply-To: <18427.1101931618@sss.pgh.pa.us>
References: <95241C28-43B8-11D9-AD0F-000D93AD2E74@mobygames.com>
<18427.1101931618@sss.pgh.pa.us>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: bhirt@mobygames.com, tgl@sss.pgh.pa.us
Subject: Re: query with timestamp not using index
In-Reply-To: <9CFDF39A-43E5-11D9-AD0F-000D93AD2E74@mobygames.com>
References: <95241C28-43B8-11D9-AD0F-000D93AD2E74@mobygames.com> <18427.1101931618@sss.pgh.pa.us> <9CFDF39A-43E5-11D9-AD0F-000D93AD2E74@mobygames.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox