0

looks like i do it wrong. I turned auto_explain on with adding next valued to postgresql.conf:

shared_preload_libraries = 'pg_stat_statements,pg_wait_sampling,pg_stat_kcache,auto_explain'
auto_explain.log_min_duration = '3s'

in my monitoring I can see long running queries that exceeded limit of 3s and successfully finished.

'values' here says how long query lasted: from my grafana monitoring

But when I look into my log 'postgresql-Mon.log' (and next days) there is nothing about those queries. Only a few strings about modules during database startup process.

Am I missing something?

4
  • What info is that png supposed to be conveying?
    – jjanes
    Dec 10, 2019 at 11:55
  • oh, yes, thanks, the value is the time in seconds for how long query lasted. Dec 10, 2019 at 13:45
  • Did you restart the server? Those changes will not take effect until a restart (I don't think a reload is sufficient).
    – jjanes
    Dec 10, 2019 at 13:48
  • Yes I did. Actually super heavy queries appeared there, so, will focus on them, so hope decreasing of auto_explain.log_min_duration will help to see more queries :) Dec 10, 2019 at 13:58

1 Answer 1

0

Look over the documentation regarding this extension

pg_stat_statements does not persist between restarts... pg_stat_statements

pg_stat_statements_reset() will clear all data

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.