4 lines · 245 B
-- Hovering a reaction lists its first few reactors; this keeps that a short index range scan even when a
-- subject has tens of thousands of reactions.
CREATE INDEX reactions_listing ON reactions(subject_type, subject_id, content, created_at);