MySQL Forums
Forum List  »  Optimizer & Parser

Re: SQL Newbie needs urgently help! [optimizing query]
Posted by: Björn Steinbrink
Date: January 24, 2007 03:19PM

Hm, I wonder about MySQL's decision for the index usage. Categories, aka item_t1, is joined last and there's a condition that can use the primary key of that table.
Could you try adding "FORCE INDEX(PRIMARY)" right after "Categories item_t1"? Maybe MySQL tries to avoid reading the value for SourcePK (key_len 92 seems huge), but there are only two rows expected to be read, which should make that still perform a lot better than reading 18000 rows from Categories to perform the checks for the other conditions...

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: SQL Newbie needs urgently help! [optimizing query]
2181
January 24, 2007 03:19PM


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.