문제

I used PostgreSQL 9.5 on a server and I ended up migrating the data to a new server using PosgreSQL 12.

Should I perform a REINDEX for all tables or just ANALYZE for all tables?

도움이 되었습니까?

해결책

If you use pg_dump/pg_restore, then all indexes are created during pg_restore (after the data was loaded), so there is no reason to run reindex.

pg_restore however, does not import any statistics, so running analyze directly after running pg_restore is a very good idea.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top