Search Postgresql Archives

Re: Query planner refuses to use index

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

 



Kilian Hagemann <hagemann1@xxxxxxxxxxxxx> writes:
>> - what version are you running?

> 7.4.8, not sure if I'm ready for 8 yet.

Pre-8.0 tends to underestimate the correlation of a multicolumn index.
(8.0 may too, but not as much.)

> Also, note that set_id is strictly increasing (hence correlation of 1) and 
> rec_time is strictly increasing within records with same set_id.

So the reason the indexscan is so good is that the ordering correlation
is perfect.  This isn't the planner's default assumption, and
unfortunately we haven't got statistics available that would allow
correlation of a multicolumn index to be estimated well.

			regards, tom lane

---------------------------(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