Improve the speed of a JOIN by arranging your comparisons properly.Instead of placing your comparisons for a join with the primary query, as in:SELECT foo.idFROM tblfoo AS fooJOIN tblbar AS bar ON bar.fooId = foo.idWHERE foo.type = 'good' AND bar.style = 'flat'Move your joined comparisons directly to the JOIN command, as in:SELECT foo.idFROM tblfoo AS fooJOIN tblbar AS bar ON bar.fooId = foo.id AND bar.style = 'flat'WHERE foo.type = 'good' AND bar.id IS NOT NULLThis reduces the size of your temporary join dataset before your primary query is executed.