MySQL is simpler than the Oracle example because MySQL only has Nested Loops and doesn’t have Hash Join.
Here is the query, like on the Oracle example from the last blog post
select max(t1.data) from t1, t2 where t1.id = t2.id and t1.clus = 1 ;
So there are only 4 examples below which all do NL joins
- full table scan on T1 and T2
- 7.83 secs
- index on T1 predicate filter column
- 7.39 secs
- index on T2 join column
- 0.49 secs
- index on both T2 join column and T1 predicate filter column
- 0.06 secs
There isn’t an idea of “explain analyze” on MySQL until MySQL 8.0.18 and I did my testing on …
[Read more]