Re: Index scan vs. Seq scan on timestamps - Mailing list pgsql-general

From Andrew - Supernews
Subject Re: Index scan vs. Seq scan on timestamps
Date
Msg-id slrncr9isp.sjo.andrew+nonews@trinity.supernews.net
Whole thread Raw
In response to Index scan vs. Seq scan on timestamps  (Per Jensen <per@net-es.dk>)
Responses Re: Index scan vs. Seq scan on timestamps  (Per Jensen <per@net-es.dk>)
List pgsql-general
On 2004-12-06, Per Jensen <per@net-es.dk> wrote:
> Why does PG not use the index on the time column in the second select,
> timeofday() has been cast to a timestamp after all.

"timestamp" is "timestamp without time zone" (not the most useful type in
the world). Your column is of type "timestamp with time zone" (correct).
The relationship between the two is not trivial and the lack of an index
scan therefore expected. Try casting to "timestamp with time zone" instead.

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: select single entry and its neighbours using direct-acess to index?
Next
From: Eric E
Date:
Subject: Re: Auditing with shared username