Hi,
3)As pg_stat_statements holds the aggregated stats of all the execution for a particular sql query ,so it's not easy to identify if in the past at some point in time the same query suffered and thus went for high response time. So to debug such performance issues scenarios , is it advisable to insert the records from this pg_stat* views to another table manually periodically through a cron job?
As per my understanding , the pg_stat_statements stores the aggregated statistics of the query execution history(with almost near real time executions) and the max number of statements or queries it can store depends on the pg_stat_statement.max value(which I am seeing as ~5000 in pg_settings). I have below questions,
1)Doing a count(*) on pg_stat_statements giving ~4818. But still pg_stat_statements_info showing ~1990 as "dealloc" which means there are more sql queries coming up and they are getting flushed out of the pg_stat_statements, so does it mean that we should increase the pg_stat_statement.max to further higher value?
2)The stats_reset column in pg_stat_statements_info view is showing as 16th august , so does it mean that, whatever query stats are getting logged in the pg_stat_statements, those are the aggregated stats for all the executions that have happened since the day 16th august till today? Also as we have not done any "stats reset" manually , so does it happen automatically when the DB instance restarts or with any other database events?
1)Doing a count(*) on pg_stat_statements giving ~4818. But still pg_stat_statements_info showing ~1990 as "dealloc" which means there are more sql queries coming up and they are getting flushed out of the pg_stat_statements, so does it mean that we should increase the pg_stat_statement.max to further higher value?
2)The stats_reset column in pg_stat_statements_info view is showing as 16th august , so does it mean that, whatever query stats are getting logged in the pg_stat_statements, those are the aggregated stats for all the executions that have happened since the day 16th august till today? Also as we have not done any "stats reset" manually , so does it happen automatically when the DB instance restarts or with any other database events?
3)As pg_stat_statements holds the aggregated stats of all the execution for a particular sql query ,so it's not easy to identify if in the past at some point in time the same query suffered and thus went for high response time. So to debug such performance issues scenarios , is it advisable to insert the records from this pg_stat* views to another table manually periodically through a cron job?
Regards
Veem