Skip to content

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

Open
raymondjacobson wants to merge 1 commit into
mainfrom
codex/db-audit-drop-ubh-mint-index
Open

perf(db): drop unused balance history mint index#907
raymondjacobson wants to merge 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

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