Re: how to troubleshoot a wrong query plan

Поиск
Список
Период
Сортировка
От jian xu
Тема Re: how to troubleshoot a wrong query plan
Дата
Msg-id BL0PR02MB456100A86F1081148D6DBE82A19FA@BL0PR02MB4561.namprd02.prod.outlook.com
обсуждение исходный текст
Ответ на Re: how to troubleshoot a wrong query plan  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: how to troubleshoot a wrong query plan  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
Thanks Tom, except for setting parameters, is there any other ways to show debug information about plan generating? For example, can pg show all the candidate plans it searched, and the cost of each candidate plan?


From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Wednesday, December 27, 2023 4:21:51 PM
To: jian xu <jamesxu@outlook.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: how to troubleshoot a wrong query plan
 
jian xu <jamesxu@outlook.com> writes:
> Sorry, we figured out that the PostgreSQL.conf has the nestloop disabled….that’s why It picked merge join by default
> But it might be still very helpful if there is a way to show how the plan is generated , or some debug information about the plan generating, for example in this case, if we can debug the plan and see nestloop is disable, it will be easy for us figure out the problem.

In supported releases of PG, there's the EXPLAIN (SETTINGS) option, which
will print the values of any non-default settings that affect planning.
Of course, you have to remember to use that, but it does respond to
your point.

                        regards, tom lane

В списке pgsql-admin по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: how to troubleshoot a wrong query plan
Следующее
От: Tom Lane
Дата:
Сообщение: Re: how to troubleshoot a wrong query plan