Compound Query filter by multiple objectId

So any thoughts? Or workarounds on how to implement functionality like described above? Is the only way is use Compound with hundreds of equals operators??