9 messages in com.mysql.lists.mysqlRe: Insane execution time for JOIN query
FromSent OnAttachments
Kim Christensen31 Aug 2006 02:12 
Brent Baisley31 Aug 2006 05:51 
Kim Christensen31 Aug 2006 06:12 
Brent Baisley31 Aug 2006 06:57 
Kim Christensen31 Aug 2006 07:13 
mos31 Aug 2006 08:42 
Harrison Fisk31 Aug 2006 09:27 
Kim Christensen31 Aug 2006 23:35 
dpgi...@mdanderson.org01 Sep 2006 06:27 
Subject:Re: Insane execution time for JOIN query
From:mos (mos@fastmail.fm)
Date:08/31/2006 08:42:59 AM
List:com.mysql.lists.mysql

Kim, The first thing I'd do is run a MyISAMChk on the table to see if the index is damaged. The second thing I'd do is run Optimize on the tables regularly because after a lot of rows have been deleted it leaves holes in the table which slows down table performance.

Of course you can do an Explain on:

select * from products LEFT JOIN items ON products.product_id = items.product_id WHERE items.product_id IS NULL;

to see if it is using the index. And finally turning it into a Subselect might speed it up. (Yes, subselects can run faster than table joins in some cases)

Mike