Re: Getting all the plans. - Mailing list pgsql-general

From Tom Lane
Subject Re: Getting all the plans.
Date
Msg-id 34221.1742660201@sss.pgh.pa.us
Whole thread Raw
In response to Getting all the plans.  (Senthilnathan M <senthilnathan.maadasamy@gmail.com>)
List pgsql-general
Senthilnathan M <senthilnathan.maadasamy@gmail.com> writes:
>   I came across this extension which shows all the plans considered by the
> optimizer: https://github.com/misachi/pg_all_plans

>   Is there a way we can get this information directly instead of using an
> extension?  If not, does it make sense to add native support?

The reason it's an extension is that the idea has already been
rejected (many times) by the core project.

FYI, this particular version is not showing you anywhere near "all"
the considered plans.  That's impossible really because the planner
prunes the search space as heavily as it can.  Most potential plans
are not carried as far as generating a complete Path tree in the
first place.  Even the ones that do get to the "final rel" stage
will be thrown away if they are dominated by some other one on
all the planner's figures-of-merit.  So this is going to show you
only a small fraction of the possible plans.  If you are unhappy
because you suspect the planner rejected what would really have
been the best plan, the odds are good this won't help you because
the plan you want to see didn't survive long enough to be shown.

            regards, tom lane



pgsql-general by date:

Previous
From: Senthilnathan M
Date:
Subject: Getting all the plans.
Next
From: Kevin Stephenson
Date:
Subject: Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000