Automated setup: always recalculate statistics when restored from a dump
Goal
When we use "logical" data provisioning, restoring from a dump, initially, there are no actual stats in the database. As the last step for the restore job, there should be stats recalculation.
Without stats, the optimizer chooses sub-optimal plans.
TODO / How to implement
After running pg_restore, always run vacuum analyze freeze;
in the target database.
Acceptance criteria
As us user, using "logical" data retrieval approach (for example, for an RDS database as a source), I get the result with up-to-date stats, so the performance, the SQL execution plans are good.