postgres=# select * from sessions where video_id = '-6xA5JI4irI';

Include ANALYZE steps in all dumps, part 1

· 44:37 · SQL & client

Preserve or trigger statistics collection in dump/restore output.

session summary

The group investigated why pg_restore leaves restored relations without planner statistics and agreed that a database-wide ANALYZE in pg_restore would be too coarse. Instead, pg_dump should add an ANALYZE entry for every dumped table so archive filtering and partial restores retain correct behavior. They explored directory-format archives, TOC dependencies, table-data files, materialized-view refresh ordering, and index ArchiveEntry code. They concluded ANALYZE belongs after data, indexes, and materialized-view population, then began defining a new DumpableObject type before the call ended.

timecodes

  1. Why restored databases need ANALYZE
  2. Choosing pg_dump over a global pg_restore step
  3. Materialized views as the ordering model
  4. Exploring directory archives and the TOC
  5. How table definitions and data entries connect
  6. ANALYZE must follow indexes and refreshes
  7. Adding a new DumpableObject priority
  8. Learning from index ArchiveEntry generation