Re: Do cast affects index usage? - Mailing list pgsql-performance

From Tom Lane
Subject Re: Do cast affects index usage?
Date
Msg-id 21823.1350074311@sss.pgh.pa.us
Whole thread Raw
In response to Do cast affects index usage?  ("Anibal David Acosta" <aa@devshock.com>)
Responses Re: Do cast affects index usage?  ("Anibal David Acosta" <aa@devshock.com>)
List pgsql-performance
"Anibal David Acosta" <aa@devshock.com> writes:
> I have a table with a column of type timestamp with time zone, this column
> has an index

> If I do a select like this
> select * from mytable where cast(my_date as timestamp without time zone) >
> '2012-10-12 20:00:00'
> this query will use the index over the my_date column?

No.  The cast seems rather pointless though ...

            regards, tom lane


pgsql-performance by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Do cast affects index usage?
Next
From: Tomas Vondra
Date:
Subject: Re: hash aggregation