fix(notifications): cost the followed-accounts subselect once
Wrap the followed ap_ids subselect in keep_following_or_not_domain_blocked in ARRAY(...) so it becomes an InitPlan. As a plain subselect the planner charged its startup per rescan of the actor lookup, which could make Notification.for_user pick a plan that scans every active user per row.
This commit is contained in:
parent
f53342775d
commit
635bc19ac8
3 changed files with 24 additions and 2 deletions
1
changelog.d/domain-block-subplan-cost.fix
Normal file
1
changelog.d/domain-block-subplan-cost.fix
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fix notification and timeline queries for users with domain blocks choosing a plan that scans every active user per row; the followed-accounts exception is now an `ARRAY(SELECT ...)` InitPlan that the planner costs once.
|
||||
Loading…
Add table
Add a link
Reference in a new issue