If I take away the diagonalSize condition in my query I find that there are 225 rows that satisfy the other conditions. 155 of these have a diagonalSize value of exactly 50.000, while the remaining 70 rows all have values larger than 50. Thus there is a big discrete jump in the number of rows at a diagonalSize of 50. However, the statistics are off by two orders of magnitude in guessing how many rows there are going to be in this case and thus is not using my index. How can I fix that?

Maybe you should drop your random_page_cost to something less than 4, eg. 3 or even 2...

Maybe you should drop your random_page_cost to something less than 4, eg. 3 or even 2...

Chris

---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?

`http://www.postgresql.org/docs/faqs/FAQ.html`