On Sat, Aug 10, 2013 at 5:24 PM, Tim Kane <tim.kane@gmail.com> wrote:
>
> Again, just thinking out loud here.. In a scenario where specific
> clustering isn't an option...
> I wonder if the query planner should consider the physical
> distribution/ordering of values on disk, and use that as a factor when
> applying the random_page_cost in the QEP's?
It does do that, based on the "correlation" column in pg_stats.
However, because your original random_page_cost is already very close
to seq_page_cost, this adjustment doesn't have a huge effect in your
case. I don't know how much of an effect it would have even then,
because of the range overlap issue that Tom mentions.
Cheers,
Jeff