activity: when restricting deactivated users, precalculate the user list
authorAriadne Conill <ariadne@dereferenced.org>
Fri, 6 Sep 2019 23:14:29 +0000 (23:14 +0000)
committerAriadne Conill <ariadne@dereferenced.org>
Fri, 6 Sep 2019 23:14:29 +0000 (23:14 +0000)
commit40a61532cadbac8b196917c6f5843c3f6cd7e78b
treedb1fc156e659cfcb5ec3ba9502ac9f2fc5ee6959
parent5effb2cbca51534a68dad1c5a4dd24b1ae08360a
activity: when restricting deactivated users, precalculate the user list

the PostgreSQL query planner is easily confused due to the complexity of
certain queries we make.  while we plan to simplify these queries through
unification of activities and objects, we are not yet there.  it has been
discovered that using a precalculated list of deactivated users encourages
the query planner to prefer simpler indices instead of the
activity_visibility index.

accordingly, drop the subquery and precalc the user list instead.
lib/pleroma/activity.ex