3 ms·
Be careful with this if your postgresql release is not up to date. There was a bug in the way ANALYZE updated pg_class.reltuples that could cause the value in r
by davidgould 8y ago
Be careful with this if your postgresql release is not up to date. There was a bug in the way ANALYZE updated pg_class.reltuples that could cause the value in reltuples to grow incorrectly for large tables. If the table had a lot of updates the pg_class.reltuples value would tend to increase a bit each time it got updated.
This was fixed in March 2018 and was backpatched so any binary release since then should be ok, eg 9.x.latest 10.x.latest, 11.x.
See [0] for details of the bug.
[0] https://www.postgresql.org/message-id/flat/20180117164916.3fdcf2e9%40engels https://www.postgresql.org/message-id/flat/20180117164916.3f...