Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- idx_forensic_*: debug-session indexes, not read by bot code. GIN ones are built with fastupdate
-- off, since a pending-list flush stalls the inserting webhook request for 10-30s on this tier.
DROP INDEX CONCURRENTLY IF EXISTS idx_event_rawmessage_trgm;
DROP INDEX CONCURRENTLY IF EXISTS idx_forensic_event_rawmessage_trgm;
CREATE INDEX CONCURRENTLY idx_forensic_event_rawmessage_trgm
ON event USING gin ((data->>'rawMessage') gin_trgm_ops)
WITH (fastupdate = off)
WHERE event_type = 'MessageReceived';
8 changes: 8 additions & 0 deletions src/vahter-bot/migrations/V52__mark_forensic_indexes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Remaining debug-session indexes (V30, V38, V43, V48) get the idx_forensic_ prefix so the
-- catalog itself shows which indexes no bot query depends on.
ALTER INDEX IF EXISTS idx_event_username_lower RENAME TO idx_forensic_event_username_lower;
ALTER INDEX IF EXISTS idx_event_user_ban_by_stream RENAME TO idx_forensic_event_user_ban_by_stream;
ALTER INDEX IF EXISTS idx_event_mlscored_score_created_at RENAME TO idx_forensic_event_mlscored_score_created_at;
ALTER INDEX IF EXISTS idx_snapshot_user_username RENAME TO idx_forensic_snapshot_user_username;
ALTER INDEX IF EXISTS idx_snapshot_user_banned RENAME TO idx_forensic_snapshot_user_banned;
ALTER INDEX IF EXISTS idx_snapshot_user_spam_protection RENAME TO idx_forensic_snapshot_user_spam_protection;
Loading