circagraph
Sign inSign up

openchronology/timeline-app on GitHub

The OpenChronology repository on GitHub, mirrored by och-import-github: issues and pull requests as durations (ongoing while open), what happened to them as moments, plus releases, milestones, commits and branches. The Branches view shows the most recently active branches each in a track of its own.

Source: https://github.com/openchronology/timeline-app

3,131 moments · 2026-10-05 CE 20:21:49 UTC – 2026-11-16 CE 12:10:45 UTC · by @athan · @athan

#161 Vacuum and analyse the large tables after 1-2% of them change

–

  • github
  • github/openchronology/timeline-app
  • github/openchronology/timeline-app#161
  • pull request
  • state:merged

The last change for #135, as proposed in [the issue comment](https://github.com/openchronology/timeline-app/issues/135#issuecomment-6185695578), with no partitioning. ## What changes PostgreSQL's autovacuum defaults scale with table size: - it vacuums after 20% of a table's rows change, or after 20% more rows are added; - it refreshes the planner's statistics after 10% change. At a billion rows, that's 200 million rows before a vacuum. `server/schema.sql` now sets these on 18 large tables: the six index tables, their `_retired` versions, and the history version and override tables. | Setting | Default | Now | | --- | ---: | ---: | | `autovacuum_vacuum_scale_factor` | 0.2 | 0.02 | | `autovacuum_vacuum_insert_scale_factor` | 0.2 | 0.02 | | `autovacuum_analyze_scale_factor` | 0.1 | 0.01 | The migration sets each option only on a table that has no value of its own for it: - An administrator's own tuning survives upgrades. - When nothing needs setting, the migration runs no `ALTER TABLE`, so it takes no lock that would conflict with autovacuum. ## Testing - `test/postgres.mjs` checks that all 18 tables carry the settings. It also checks that re-running the schema keeps an administrator's value. - I ran `openchronology-migrate` twice against the local test database: - the second run left these tables' `pg_class` rows untouched (same `xmin`); - a table whose options were reset got them back; - a value set by hand was kept. - Against the 1M-moment benchmark database, the migration took 3.5 s in total. - The full database test suite passes locally. ## Docs `docs/administration.md` explains the settings and that values set by hand survive upgrades. Closes #135. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/pull/161

Related

Open #161 Vacuum and analyse the large tables after 1-2% of them change in the timeline

#161 Vacuum and analyse the large tables after 1-2% of…