4 ms·
At least in Postgres, you can use ANY and pass an array of values. From what I've read, the generated query plan is equivalent.
by icebraining 10y ago
At least in Postgres, you can use ANY and pass an array of values. From what I've read, the generated query plan is equivalent.
- masklinn 10y ago> From what I've read, the generated query plan is equivalent. I believe at one point IN (values) was just sugar for = ANY(ARRAY(values)), don't know if that's still the case. Still requires that your DB adapter supports array parameters though.
- snuxoll 10y agoAlternatively, you can use a temp table and a join. Not ideal, but still safe from injection and should have roughly the same overhead in the database.