Search Postgresql Archives

Re: Timestamp indexes (why ">" or "between" does not use index?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Feb 16, 2008, at 9:42 , Phoenix Kiula wrote:

The EXPLAIN tells me it needs to do a seq
scan. Why is this? How can I make a date/time field index which uses
both equality criteria and the greater than/lesser than/between
criteria?



The planner will choose a seq scan if it thinks that it will be faster than using an index: if based on its statistics it thinks a large portion of rows will match the criteria, a seq scan may well be faster than an index scan.

Have you analyzed recently? Showing us the EXPLAIN ANALYZE for your query would be helpful. Have you tried running the EXPLAIN ANALYZE with seq scans disabled?

Michael Glaesemann
grzm seespotcode net



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux