Skip to content

Commit fc9962f

Browse files
committed
feat: add index to audit table for candidate and timestamp
1 parent a90a0fb commit fc9962f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- flyway:no-transaction
2+
3+
-- Index for queries filtering by candidate with time-based ordering
4+
-- Use cases: download counts per candidate, recent activity for a candidate, time-series analysis
5+
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_audit_candidate_timestamp
6+
ON audit(candidate, timestamp DESC);

0 commit comments

Comments
 (0)