I have this query:
query = wixData.query("TaskList").hasSome("status", statusFilter).and( wixData.query("TaskList").hasSome("account", adminAccountIds).or( wixData.query("TaskList").eq("assignedBy", member.id) ));
The initial hasSome() filter is ANDed with another hasSome() filter ORed with another equality test. The hasSome() filter is itself an OR condition, so there's a whole bunch of ORing going on. The first condition hasSome("status", taskFilter) is the most restrictive so I put it first, but that got me thinking - does the order actually matter? Does Wix do some sort of optimization in the background that ignores my order? Secondly, do the inner conditions effectively run as parallel queries so that, because of my AND and OR conditions, I am in effect running 3 queries?
Any tips for improving the performance of the above query would be appreciated. I would also be interested in hearing about how Wix does query performance optimization in general.