Revert "PERF: avoid OR in complex query"

This reverts commit a8dc6daa38f1fdc09e477222451bd5a2612b59f5.