Hello.

I’d like to improve pg_stat_statements so that it can report the timestamp when the stats are reset. Currently it’s difficult to check that reset timestamp. But this information is useful, for example, when calculating the SQL executions per second by SELECT calls / (now() - reset_timestamp) FROM pg_stat_statements.

I’m thinking of adding adding a function called pg_stat_statements_reset_time() that returns the last timestamp when executed pg_stat_statements_reset(). pg_stat_statements can reset each SQL statement. We can record each sql reset timing timestamp but I don’t feel the need. This time, I’m thinking of updating the reset timestamp only when all stats were reset.

what do you think ?
Regards.

Naoki Nakamichi


Reply via email to