You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deferred from #385. kb compact (VACUUM ANALYZE + current/historical report) shipped as the safe interim bloat tool; this tracks the real table-partitioning rewrite, to revisit only when the historical tail is genuinely large (10M+ superseded rows).
Why deferred
The real risk is correctness, not data size: converting a populated table to declarative partitioning is a rewrite (create partitioned table → copy → swap) that must faithfully recreate every index, unique constraint, and FK. A partitioned table also forces the partition key into every unique index — nodes_identity_current_uniq (scope_key, canonical_name) WHERE status='current' and edges_current_uniq need rework, and edges' from_id/to_id FKs to a partitioned nodes need re-establishing.
Supersession flips status current→historical, which would move rows across partitions on every update (supported since PG 11, but with overhead).
Scope when picked up
Design the partition key (status, or a bool is_current), and the unique-constraint / FK implications.
A one-time migration that does not block boot — an explicit kb partition maintenance command (backup-first, --force), or a documented maintenance-window procedure. Never an auto-boot migration.
Deferred from #385.
kb compact(VACUUM ANALYZE + current/historical report) shipped as the safe interim bloat tool; this tracks the real table-partitioning rewrite, to revisit only when the historical tail is genuinely large (10M+ superseded rows).Why deferred
nodes_identity_current_uniq (scope_key, canonical_name) WHERE status='current'andedges_current_uniqneed rework, and edges'from_id/to_idFKs to a partitionednodesneed re-establishing.statuscurrent→historical, which would move rows across partitions on every update (supported since PG 11, but with overhead).Scope when picked up
status, or abool is_current), and the unique-constraint / FK implications.kb partitionmaintenance command (backup-first,--force), or a documented maintenance-window procedure. Never an auto-boot migration.Meanwhile
kb compactreclaims superseded-row bloat safely (non-blocking VACUUM ANALYZE). Run it afterkb sweep-retention.P2, area:scale.
🤖 Generated with Claude Code