Postgres 10.4
Postgres 9.6
Problem on both versions
I want to collect postgresql slow queries plan, so I added to my postgresql.conf setting from documentation
session_preload_libraries = 'auto_explain'
auto_explain.log_min_duration = '5s'
in the end of config
But also we use
logging_collector = true
and if logging_collector is on, no explain in logs
If logging_collector commented, I can see plan of queries How can I use both options?
UPDATE: We had about 10 queries runs more than 5 seconds, but finally with grep we found only one output in log with explain instead of all plans How it could be only one record was logged? neither all plans, no no plans only one explain
-
Works for me. Could it be that the other long queries were run over existing connections (perhaps with a connection pooler) for which the session_preload_libraries has not taken effect?jjanes– jjanes2018年08月21日 11:56:06 +00:00Commented Aug 21, 2018 at 11:56
-
All queries were run from Elixir Phoneix application with pool of connections, and yes, be application was not restartedMaryna Krasnova– Maryna Krasnova2018年08月21日 12:04:22 +00:00Commented Aug 21, 2018 at 12:04
-
Please add your answer as answer, so I'll mark this as solution. Really, the statistic of slow queries did not displayed immediately because of connection pool was created before log_min_duration was turn onMaryna Krasnova– Maryna Krasnova2018年09月07日 12:16:20 +00:00Commented Sep 7, 2018 at 12:16
1 Answer 1
Works for me.
Could it be that the other long queries were run over existing connections (perhaps with a connection pooler) for which the session_preload_libraries has not taken effect?