Re: Convincing the query planner to play nice - Mailing list pgsql-general

From Jeff Janes
Subject Re: Convincing the query planner to play nice
Date
Msg-id CAMkU=1yVwN=3OqsV+Z_zSkXGtw2=vD62tcOUtW=o5eAMaPcpxw@mail.gmail.com
Whole thread Raw
In response to Re: Convincing the query planner to play nice  (Tim Kane <tim.kane@gmail.com>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Please help
Next
From: Brian Hirt
Date:
Subject: View permission error after upgrading from 8.4 -> 9.2