On Tue, Feb 15, 2011 at 10:00 AM, Derrick Rice <derrick(dot)rice(at)gmail(dot)com> wrote:
> Is the query optimizer capable of using the relationship between an index on
> date_trunc(foo) and a query with "where foo < bar and foo > baz" ? At this
> point the question is to satisfy my own curiosity.
No. The query has to use the same function as the index does.
I also don't think that the storage space will be any less. A
timestamp is always stored in the same amount of space. All you're
doing is zeroing out the higher resolution bits of time.