Maintain scoped operation history totals without table scans

This commit is contained in:
2026-10-06 14:53:51 -04:00
parent b17673720b
commit 703d414c7a
5 changed files with 89 additions and 1 deletions
@@ -179,6 +179,9 @@ describe('routine host observation retention', () => {
retained.push(malformed);
api.handle.exec('DROP INDEX ec_host_operations_observation_retention');
api.handle.exec('DROP INDEX ec_host_operations_important_history');
api.handle.exec(`DROP TRIGGER operation_history_count_insert; DROP TRIGGER operation_history_count_delete;
DROP TRIGGER operation_history_count_update; DROP TABLE ec_host_operation_history_counts;
DELETE FROM ec_host_schema_migrations WHERE name='history-counts-v1'`);
api.handle.exec('ALTER TABLE ec_host_operations DROP COLUMN observation_success');
api.closeDb();