Re: Getting query plan alternatives from query planner?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stefan Keller <sfkeller(at)gmail(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Getting query plan alternatives from query planner?
Date: 2014-03-20 17:08:50
Message-ID: 15606.1395335330@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Stefan Keller <sfkeller(at)gmail(dot)com> writes:
> I'd like to know from the query planner which query plan alternatives
> have been generated and rejected. Is this possible?

No, not really. People have occasionally hacked the planner to print
rejected paths before they're discarded, but there's no convenient way
to do anything except send the data to the postmaster log, which isn't
all that convenient. A bigger problem is that people who are asking
for this typically imagine that the planner generates complete plans
before rejecting them; which it does not. 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.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Torsten Förtsch 2014-03-20 17:13:58 Re: Performance of UNION vs IN
Previous Message Jean-Max Reymond 2014-03-20 16:57:41 Performance of UNION vs IN