Re: EXPLAIN with anonymous DO block?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: EXPLAIN with anonymous DO block?
Дата
Msg-id CAKFQuwayiLqaAHHoL5xLgNgMcNRtB+Ymh8MeXj8tRjLMQLTS_Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: EXPLAIN with anonymous DO block?  (Michael Lewis <mlewis@entrata.com>)
Список pgsql-general
On Thu, Jul 1, 2021 at 9:22 AM Michael Lewis <mlewis@entrata.com> wrote:
It sounds like you are wanting to run 'explain analyze [query]' inside a loop inside a DO block. That isn't possible as far as I know, but auto_explain and log_nested_statements should be able to let you profile the whole thing and perhaps you can pick out the part you want from the logs.

I believe it can be done technically, though basically the function will need to be re-written for the purpose. It isn't as simple as adding an explain somewhere since the output of explain is a result set.  But as you are already using pl/pgsql  then your parameters can just be done up as variables instead and that query should be able to be explained.

David J.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: EXPLAIN with anonymous DO block?
Следующее
От: Pavel Luzanov
Дата:
Сообщение: Re: EXPLAIN with anonymous DO block?