Re: Speed differences between joins and subqueries?

2004-06-05 Thread Yves Goergen
On 04.06.2004 20:46 (+0200), Sasha Pachev wrote:
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.
Could there be a program that I can present my query and it gives me 
some alternatives with a benchmark of them? This may help me to create 
optimized queries and may inspire me to optimize them even further into 
a direction I didn't think of yet...

--
Yves Goergen <[EMAIL PROTECTED]>
BlackBoard Internet Newsboard System --> blackboard.unclassified.de
Free (GPL), easy to use and install, secure, innovative! (PHP+MySQL)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Speed differences between joins and subqueries?

2004-06-04 Thread Sasha Pachev
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]


Speed differences between joins and subqueries?

2004-06-01 Thread Daniel Ek
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.

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