CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_events_account_created ON account_events (account_id, created_at DESC) INCLUDE (event_type) WHERE deleted_at IS NULL; EXPLAIN (ANALYZE, BUFFERS) SELECT event_type, created_at FROM account_events WHERE account_id = 42 AND deleted_at IS NULL ORDER BY created_at DESC LIMIT 50;