With pgfouine when we load the shared_preload_libraries auto_explain. the report generated with pgfouine give the plan with the request found in log.
It is not implemented with pgbadger.
Was it a bug in pgfouine ?
Are you going to reproduce this fonctionality with pgbadger or not ?
I don't have such log file, if someone can add this feature I will be please to apply the path.I think in the top slowest queries we can add a [ See plan ] button for this purpose.
This is not a common usage so it will not been included in pgbadger at least by me. If someone want to develop the feature, patch is welcome.
I'm move the issue with enhancement flag.
+1. This would be really great to have actually. The natural question to ask when you see the slowest queries is of course: why were they slow
This commit could interest you :
[master 0ce0123] Allow pgbadger_tools --explain-slowest to automatically execute the EXPLAIN statements an report the plan. See pgbadger_tools --help for more explanation.
The tools/pgbadger_tools is used to demonstrate how we can use the binary files generated by pgBadger and the first example is a tool that allow you to get the detailed explain plan of the slowest queries.
I'm agree that this is not the same of having the right plan at the time of the query execution but it could be useful.
Latest commits add this feature, auto_explain explain plans are shown in-line with top queries when available. If you click on the Explain plan label the plan will be automatically loaded on explain.depesz.com