Skip to content
Open
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
10 changes: 10 additions & 0 deletions ddl/migrations/0218_playlist_trending_scores_ordered_idx.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- Hot playlist trending callers order by score DESC, playlist_id DESC after
-- filtering on type/version/time_range. Put the ordering columns immediately
-- after the equality predicates so PostgreSQL can satisfy the LIMIT without a
-- parallel scan and sort.

create index concurrently if not exists idx_playlist_trending_scores_ordered
on playlist_trending_scores (type, version, time_range, score desc, playlist_id desc);

comment on index idx_playlist_trending_scores_ordered is
'Covers playlist trending endpoints ordered by score desc, playlist_id desc.';
Loading