Daniel Ek wrote:
Hi all,

I am wondering if anyone have any knowledge if there is speed difference between joins (inner | outer | left | right) and subqueries. Would I actually gain preformance using subqueries (new since 4.1) against using the "old" joins?

Would be interesting to hear comments on this matter, and also a detailed explanation on which is to prefer and why.

Subquery optimizer is still is a very early stage in 4.1. Much more often than not, a carefully crafted join, union, or a sequence of queries using a temporary table will be faster. In fact, I wonder if it is even possible to write a machine subquery optimizer that will outperform a good human "optimizer" that re-writes them into something better digestible. Kind of like no super-smart JIT will ever beat a good C programmer on execution speed, although it might help with the development time.



-- Sasha Pachev Create online surveys at http://www.surveyz.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to