Skip navigation links

MySQL Forums :: Optimizer & Parser :: Optimizing left outer join query


Advanced Search

Re: Optimizing left outer join query
Posted by: Toa Sty ()
Date: September 25, 2006 03:00AM

Hi Muhammad,

How many rows would you expect vendor_id = 1002 to match? I ask because for some reason MySQL is deciding to table-scan all of vendor_products which seems odd considering you have an index on vendor_id. If most of the rows in the vendor_products table have a vendor_id of 1002 then I'd expect this behaviour but otherwise I wouldn't.

Try running ANALYZE TABLE on both tables and re-running the explain query to see if you get a better result.

Can you post the explain plan afterwards either way please? It would be good to see a count of the number of vendor_id=1002 rows too.

HTH,
Toasty

-----------------------------------------
email: 'toasty'*3 at gmail

Options: ReplyQuote


Subject Views Written By Posted
Optimizing left outer join query 12345 Muhammad Imran Khalid 09/24/2006 11:40PM
Re: Optimizing left outer join query 4104 Toa Sty 09/25/2006 03:00AM
Re: Optimizing left outer join query 3538 Muhammad Imran Khalid 09/25/2006 04:54AM
Re: Optimizing left outer join query 3691 Toa Sty 09/25/2006 08:09AM
Re: Optimizing left outer join query 3090 KimSeong Loh 09/25/2006 09:55PM
Re: Optimizing left outer join query 3038 Toa Sty 09/26/2006 03:35AM
Re: Optimizing left outer join query 2694 Muhammad Imran Khalid 09/26/2006 03:46AM
Re: Optimizing left outer join query 4232 Toa Sty 09/26/2006 04:06AM
Re: Optimizing left outer join query 2555 KimSeong Loh 09/26/2006 06:31PM


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.