Re: Convincing the query planner to play nice

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Tim Kane <tim(dot)kane(at)gmail(dot)com>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Convincing the query planner to play nice
Date: 2013-08-13 16:46:49
Message-ID: CAMkU=1yVwN=3OqsV+Z_zSkXGtw2=vD62tcOUtW=o5eAMaPcpxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Aug 10, 2013 at 5:24 PM, Tim Kane <tim(dot)kane(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brian Hirt 2013-08-13 16:54:53 View permission error after upgrading from 8.4 -> 9.2
Previous Message Adrian Klaver 2013-08-13 16:45:39 Re: Please help