Uh oh!
There was an error while loading. Please reload this page.
Add created_at indexes for faster get_feed. - #2664
Conversation
Also convert some existing indexes to partial indexes.
raymondjacobson
left a comment
There was a problem hiding this comment.
Maybe worth separating the PRs into the ones that are additive and the ones that are mutations
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
raymondjacobson
left a comment
There was a problem hiding this comment.
DROP INDEX IF EXISTS makes sense to me just as a guard rail, but otherwise, PR looks good to me!
Don't omit is_delete rows as they are used a lot in the update_aggregate_user queries.
After looking more at https://github.com/AudiusProject/audius-protocol/blob/master/discovery-provider/src/tasks/index_aggregate_user.py#L20 I agree with Ray's suggestion from Slack about not omitting We could maybe consider a compound index like |
This reverts commit faa2c5c.
Also convert some existing indexes to partial indexes.
Description
get_feeddoes a lot oforder by created_at desc limit 20type of queries, but there's no index oncreated_atwhich results in a materialization and sort of the full intermediate result set.Before:
Tests
Stand by for some more concrete before and after numbers.
How will this change be monitored? Are there sufficient logs?
GCP SQL panel