shlogg · Early preview
Franck Pachot @franckpachot

How To Revert The Effects Of ANALYZE In YugabyteDB And PostgreSQL

Reverting ANALYZE in YugabyteDB: delete from pg_statistic, update pg_class to reset reltuples and column statistics. Note: modifying catalog tables requires explicit permission.

Anything I do, especially when it can change execution plans, should have its counterpart to revert back. In PostgreSQL we have an ANALYZE that gathers the statistics used by the query planner, but nothing to remove them. The idea is probably that, anyway, the automatic statistic gathering will put them back. But I still want to be able to control, at least for testing.
In YugabyteDB we use the PostgreSQL query planner but with additions to be cluster-aware, because it is a distributed SQL database. This is still in development. In the current version (2.11) ANALYZE is still a beta feature:

y...