From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Senthilnathan M <senthilnathan(dot)maadasamy(at)gmail(dot)com> |
Cc: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: Getting all the plans. |
Date: | 2025-03-22 16:16:41 |
Message-ID: | 34221.1742660201@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Senthilnathan M <senthilnathan(dot)maadasamy(at)gmail(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2025-03-22 16:24:43 | Re: query_id: jumble names of temp tables for better pg_stat_statement UX |
Previous Message | Senthilnathan M | 2025-03-22 15:31:57 | Getting all the plans. |