pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Anibal David Acosta <aa@devshock.com>
To: pgsql-performance@postgresql.org
Subject: Do cast affects index usage?
Date: Fri, 12 Oct 2012 17:05:52 -0300
Message-ID: <004301cda8b4$fdc57bd0$f9507370$@devshock.com> (raw)

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?

 

Thanks

 

view thread (5+ messages)  latest in thread

Message-ID: <004301cda8b4$fdc57bd0$f9507370$@devshock.com>
Permalink:  ../004301cda8b4$fdc57bd0$f9507370$@devshock.com/
Also on:    postgresql.org/message-id/004301cda8b4$fdc57bd0$f9507370$@devshock.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: aa@devshock.com
  Subject: Re: Do cast affects index usage?
  In-Reply-To: <004301cda8b4$fdc57bd0$f9507370$@devshock.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