reduce number of chars to index for search

This commit is contained in:
Weves 2025-02-25 19:27:33 -08:00 committed by Chris Weaver
parent f767b1f476
commit 23073d91b9

View File

@ -17,11 +17,11 @@ depends_on = None
def upgrade() -> None:
# Create a basic index on the lowercase message column for direct text matching
# Limit to 2000 characters to stay well under the 8191 byte limit
# Limit to 1500 characters to stay well under the 2856 byte limit of btree version 4
op.execute(
"""
CREATE INDEX idx_chat_message_message_lower
ON chat_message (LOWER(substring(message, 1, 2000)))
ON chat_message (LOWER(substring(message, 1, 1500)))
"""
)