Optimize multi-type query
%KnfsXpRr3UY3WyIZwZsFJRCWJZpkTbHux3L6J6laebU=.sha256
master
from optimize
Optimize multi-type query
The first object in the query array should be a $filter
object
that the query plugin can use to select a continguous range of messages in one of its indexes. $in
can select a discontiguous range, which when used as the first query object results in slow queries. Since the message types selected share a common distinguishing prefix, we can use $prefix
to select them. Then a second $filter
object subsequently filters the results by the exact message types.
Note that if more message types are in the future added lexicographically between patchboot-app
and patchboot-webapp
, those will be included in the first filter. If there are a lot of such messages, it will slow down this query. This query could then be reimplemented using multiple calls to query.read
.
optimize
branch · 1/20/2021, 12:00:08 AMBuilt with git-ssb-web