Search Postgresql Archives

Re: EXPLAIN with anonymous DO block?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 1, 2021 at 9:22 AM Michael Lewis <mlewis@xxxxxxxxxxx> 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.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux