Skip to content

perf(db): drop unused balance history mint index#907

Merged
raymondjacobson merged 1 commit into
mainfrom
codex/db-audit-drop-ubh-mint-index
Jun 8, 2026
Merged

perf(db): drop unused balance history mint index#907
raymondjacobson merged 1 commit into
mainfrom
codex/db-audit-drop-ubh-mint-index

Conversation

@raymondjacobson

Copy link
Copy Markdown
Member

Summary

  • drops user_balance_history_user_mint_timestamp_idx concurrently
  • keeps user_balance_history_user_timestamp_idx, which covers the API endpoint predicate

Production evidence

  • the database audit found user_balance_history_user_mint_timestamp_idx at roughly 78 GB with idx_scan = 0
  • api/v1_users_balance_history.go filters by user_id and timestamp, not mint
  • dropping the unused wider index removes write amplification, vacuum overhead, and cache pressure from a large table

Verification

  • migration review only; SQL is DROP INDEX CONCURRENTLY IF EXISTS
  • no application code changed

@raymondjacobson raymondjacobson merged commit 8781f4f into main Jun 8, 2026
5 checks passed
@raymondjacobson raymondjacobson deleted the codex/db-audit-drop-ubh-mint-index branch June 8, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant