Skip to content

perf(db): add chat message range index#937

Open
raymondjacobson wants to merge 1 commit into
mainfrom
codex/chat-message-access-index
Open

perf(db): add chat message range index#937
raymondjacobson wants to merge 1 commit into
mainfrom
codex/chat-message-access-index

Conversation

@raymondjacobson

Copy link
Copy Markdown
Member

Summary

  • add a partial chat_message index led by chat_id and created_at for per-chat range lookups
  • drop the old created_at-led non-blast index that had 0 production scans

Evidence

  • pg_stat_statements showed a chat fanout/unread query as the top temp-I/O statement on the primary, with ~378TB temp I/O over the stats window
  • pg_stat_user_indexes showed chat_message_non_blast_created_at_idx had idx_scan = 0
  • current chat unread/message paths constrain by chat_id and created_at, so this index matches the access pattern more closely

Test

  • git diff --check

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