Whenever you load data with
pg_restore or similar tools, run
VACUUM ANALYZE on your entire database to collect new statistics.
Without these operations, the database will not have up-to-date statistics on the tables and indexes, which may in turn lead to poor query plans.
The Aiven platform will automatically run
ANALYZE on your service after performing a major version upgrade in order to ensure the statistics are up-to-date.
For more details about
ANALYZE, see the PostgreSQL documentation: https://www.postgresql.org/docs/current/static/sql-analyze.html