Summary
Investigate time-range partitioning (e.g., monthly partitions on created_at) for the append-only audit tables — system_audit_entries and audit_entries/version_snapshots — so that retention pruning on Oracle ADB becomes an instant DROP PARTITION instead of row-by-row DELETE.
Deferred from the #400 design (system-audit retention): current admin write volume (~34 /admin/* write endpoints at typical admin cadence) does not justify the machinery, so #400 ships indexed-created_at DELETE pruning. This issue tracks revisiting that decision if write volume grows.
Originally recommended by the oracle-db-admin review of the #355 schema:
Range partitioning on created_at (e.g., monthly partitions).
The right Oracle pattern for a high-write append-only audit table makes pruning a DROP PARTITION (instant, no redo, no row-by-row delete locking) instead of a DELETE.
Acceptance Criteria
Notes
Summary
Investigate time-range partitioning (e.g., monthly partitions on
created_at) for the append-only audit tables —system_audit_entriesandaudit_entries/version_snapshots— so that retention pruning on Oracle ADB becomes an instantDROP PARTITIONinstead of row-by-rowDELETE.Deferred from the #400 design (system-audit retention): current admin write volume (~34
/admin/*write endpoints at typical admin cadence) does not justify the machinery, so #400 ships indexed-created_atDELETE pruning. This issue tracks revisiting that decision if write volume grows.Originally recommended by the oracle-db-admin review of the #355 schema:
Acceptance Criteria
AutoMigratedoes not manage partitions — ainternal/dbschema/post-migration hook would own partition DDL on both PG (declarative partitioning) and Oracle (interval partitioning)DROP PARTITIONis DDL and bypasses row-level triggers — confirm this is acceptable for the immutability story (floor enforcement moves to "never drop a partition younger than the floor")Notes