MySQL Forums
Forum List  »  Docs

Re: inefficient query!
Posted by: Bill Karwin
Date: July 30, 2006 02:55PM

The SQL89 "comma-style" join syntax is not significantly more or less efficient than the SQL92 join syntax. Both should be optimized the same way after the SQL has been parsed.

If you have indexes on TB1.ID and TB2.ID, MySQL will use the indexes for fast lookups, if it calculates that this would be more efficient than reading the data rows.

Of course, the work required to do this is greater as the number of rows grows. But comparing two indexed columns is quite scalable. It is common for people do this with tables containing millions of rows.

It helps if you can increase your cache (configure the 'key_buffer_size' option for MyISAM tables, or 'innodb_buffer_pool_size' option for InnoDB tables) large enough to hold the entire indexes in memory.

Options: ReplyQuote


Subject
Views
Written By
Posted
3830
July 30, 2006 05:58AM
Re: inefficient query!
2654
July 30, 2006 02:55PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.