activitypub utils: optimize block and follow activity lookup
authorWilliam Pitcock <nenolod@dereferenced.org>
Fri, 25 May 2018 05:19:11 +0000 (05:19 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Fri, 25 May 2018 05:23:49 +0000 (05:23 +0000)
commit47dc52a75882497d00338d07a24ce978cc0f8300
treefb063487df783eb8c1f90a50432b62ec494e4ccf
parentf3a71f2986fc0787c03bec786e772353e99ae9f9
activitypub utils: optimize block and follow activity lookup

multi-field @> comparison is very expensive, so only use @> for the field where it matters
this makes the query take only a few usec to execute verses many msec on a busy instance
lib/pleroma/web/activity_pub/utils.ex