Showing alternative query planner plans with explain ?

Поиск
Список
Период
Сортировка
От Danny Shemesh
Тема Showing alternative query planner plans with explain ?
Дата
Msg-id CAFZC=QpMZutOUnJATYzLiuvM9CAk7UPpWmnZX6uGXxgHYSE6nw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Showing alternative query planner plans with explain ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hey all !

I'm currently optimizing queries and indices on a relatively large dataset;
one of the frequent questions I seem to ask myself is why the planner chooses plan A over B.

Reading the docs, blogs, stack exchange posts, wiki, ... helps in trying to tinker with the query or indices in a way that either A will be discouraged, or B will be favoured, so I'd be more informed on why one was chosen over the other and which is empirically better for a given dataset.

A tool I seem to be missing, and I wondered if such exists, is to have the planner output alternative plans for a given query, i.e. to say, give me the x top plans sorted by cost - I believe this would help shed some light on the internal state machine and subsequent tinkering less trial-and-error-ish.

Is there any way to achieve the above ?

Thanks a ton,
Danny


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

Предыдущее
От: Shaheed Haque
Дата:
Сообщение: Re: JSONB index not in use, but is TOAST the real cause of slow query?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Showing alternative query planner plans with explain ?