Files
imeai-aKode/akode-rs/state/migrations/0050_threads_section_empty_preview_indexes.sql

11 lines
407 B
SQL

DROP INDEX idx_threads_section_recency_at_ms;
DROP INDEX idx_threads_section_position;
CREATE INDEX idx_threads_section_recency_at_ms
ON threads(archived, thread_section_id, recency_at_ms DESC, id DESC)
WHERE thread_section_id IS NOT NULL;
CREATE INDEX idx_threads_section_position
ON threads(archived, thread_section_id, section_position ASC, id ASC)
WHERE thread_section_id IS NOT NULL;