0

I have read the PostgreSLQ documentation and it states that these conditions might reset the statistics' collection values:

  • Immediate Shutdown of the database
  • Server Crash (where the db is hosted)
  • Manual resetting with SELECT pg_stat_statements_reset();
  • Point-in-time recovery

I already made sure that the instace did not face a shutdown or crash and I did not manually reset the values with that query.

  • What could other reasons might trigger the values reset?

Further questions

  • Could a backup mess up these values as well?
  • How could I throubleshoot this?
  • It's just a recovery or manual reset that would reset the statistics. Never had any issues with this. I would start to log every query and analyse the query log, there could be a rogue process requesting a reset. On the other hand, are you really using PostgreSQL 9.5 ? That version unsupported for 2 or 3 years, you might have found a bug in that version. Upgrade to a recent version, version 14 or so. – Frank Heikens Oct 07 '22 at 10:46
  • I am using 9.6, there a typo on the tags. Thanks for your response. – BadProgrammer Oct 07 '22 at 10:50
  • Same issue, 9.6 is also EOL. – Frank Heikens Oct 07 '22 at 10:52
  • 2
    I'd say the best bet is, that someone else did run `pg_stat_statements_reset()` manually. –  Oct 07 '22 at 11:28
  • 'already made sure that the instace did not face a shutdown or crash'. How did you do that? – jjanes Oct 07 '22 at 12:07

0 Answers0