News for hackers. Stuff that matters.
Re:Query optimization in MySQL with Subqueries by chopsueyar on Friday February 11, 2011 @09:33AM (#2206406)
Getting rid of the 'IN' clause.
Re:Query optimization in MySQL with Subqueries by Herald_MJ on Friday February 11, 2011 @10:15AM (#2206541)
exactly. Using an IN statement with a subquery is textbook "how to make a query slow" - it forces a sequential scan. No-one who understands SQL would write a query like that.
Re:Query optimization in MySQL with Subqueries by encoderer on Friday February 11, 2011 @10:24AM (#2206575)
It's certainly a cardinal sin on MySQL but commercial platforms have optimizations that make these correlated subqueries performant.
Re:Query optimization in MySQL with Subqueries by Lozzer on Friday February 11, 2011 @10:32AM (#2206607)
It's not inherent in SQL, it's down to the optimizer