Transform certain $or queries into $in queries to boost performance.