You could do this with a one-shot SQL using a where-in clause (which is what I ended up doing), although TBH it's a micro-optimisation