I have enabled the logging for Postgres queries which are taking longer than 5000 ms. But in logs, there are lot of queries that are taking less time than the specified time when I ran those queries for the same DB using pgAdmin.
Related parameter set in parameter group:
log_min_duration_statement = 5000ms
log_statement = all
Are all the queries being logged? or am I missing something?
CodePudding user response:
You need to change log_statement
to not log all queries
log_statement = none
and instead, enable logging slow queries
log_min_duration_statement = 5000ms
these two settings are not related to each other.
Consult Postgres Documentation for more details about configurations.