Re: Getting query plan alternatives from query planner?

From: Craig James <cjames(at)emolecules(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Stefan Keller <sfkeller(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Getting query plan alternatives from query planner?
Date: 2014-03-21 13:34:55
Message-ID: CAFwQ8rd1jY6U8qQ9EahuKFpeZrSCS1vsY9GAmb3LvAGkBB9cSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

There have been many discussions about adding hints to Postgres over the
years. All have been firmly rejected by the Postgres developers, with
well-argued reasons. Search the archives to learn more about this topic.

On the other hand, Postgres does have hints. They're just called settings.
You can disable certain types of joins with SET commands. On top of that,
there are "fences" that the optimizer can't cross that you can use to force
the optimizer to consider certain sub-queries separately (e.g. "offset 0"
on a subquery).

Craig

On Fri, Mar 21, 2014 at 12:51 AM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:

>
>
>
> On Fri, Mar 21, 2014 at 1:07 PM, Stefan Keller <sfkeller(at)gmail(dot)com> wrote:
>
>> Hi Tom
>>
>> You wrote:
>> > Path alternatives are rejected
>> > whenever possible before moving up to the next join level, so that what
>> > we have rejected is actually just a plan fragment in most cases.
>>
>> Thanks for the quick answer. This sounds like a fair implementation
>> decision.
>>
>> Background for asking this is of course, that one want's 1. to
>> understand and 2. influence the optimizer in cases where one thinks
>> that the planner is wrong :-).
>>
>> So, the bottom line is
>> 1. that PostgreSQL doesn't offer no means to understand the planner
>> except EXPLAIN-ing the chosen plan?
>> 2. and there's no road map to introduce planner hinting (like in
>> EnterpriseDB or Ora)?
>>
>>
> We recently had some discussion for planner hints. There is no plan for
> having planner hints ATM. However, we are looking at ways at which we can
> improve the query planner for some cases where it makes statistical bad
> estimations and gives bad plans.
>
> Regards,
>
> Atri
>
> --
> Regards,
>
> Atri
> *l'apprenant*
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2014-03-21 14:06:51 Re: Getting query plan alternatives from query planner?
Previous Message Vincent 2014-03-21 08:17:39 Re: slow join not using index properly