Pgsql Version : 10.21.
We are consistently receiving below message in the pg_log.
‘using stale statistics instead of current ones because the stats collector is not responding’
Moreover, we have noticed significant slowdowns in DB queries occurring randomly.
Anybody faced this kind of issue and Kindly suggestion any solution for this? Thank you.
Note : As mentioned in this post restarting is not possible, since this application is in the production setup.
2
Answers
Thanks for your response.
Verified this case. Only IPV4 is enabled on the Machine.
This gave us some insights to us. We noticed that Once we get the below message in the pg_logs the very next query execution got delayed for 3 minutes. So we tried to execute the query again it got executed only in 2 Seconds. Will it be due to the stats collector being updated during the previous query execution?
Also, we are planning to upgrade pgsql version 14.7, will it solve this issue ?
If the statistics collector is not working, PostgreSQL does not gather statistics that drive autovacuum and autoanalyze, so it is not surprising if your queries perform badly. It will also lead to worse problems like table bloat.
You will have to figure out why the statistics collector is not working. Can you see the process in the process list? If no, that’s the problem. If yes, it may be that you have network problems. I once had a case where the statistics collector listened on IP v6, but IPv6 was disabled later during the startup process. See here for a write-up.
You will certainly have to restart the database once you have figured out what the problem is and fixed it. The little down time will be the least of your problems.