Hacker News new | ask | show | jobs
by taspeotis 4263 days ago
> Good solution is when you can do it: replace IN with join avoiding the shameful pit of Mysql poor performances in subqueries.

If you use MSSQL you can use IN just fine: use a table valued parameter to feed in values to look for. It's only one parameter so you get plan caching for 1, 2 ... n rows in your table valued parameter. (Although plan re-use is not always a good thing: the plan generated for 1 parameter = 1 row is necessarily the plan best suited to 1 parameter = 10,000 rows.)