MySQL Forums
Forum List  »  Optimizer & Parser

Re: force index on text & integer joiin
Posted by: KimSeong Loh
Date: February 12, 2007 07:35PM

If you do an outer join, yuo can cast the integer to char(30) and it will use the index.

Try this.
EXPLAIN Select * From table1 Left Join table2 On mdata=CAST(id AS CHAR(30))\G
EXPLAIN Select * From table2 Left Join table1 On id=mdata\G

Options: ReplyQuote

Written By
February 12, 2007 11:31AM
Re: force index on text & integer joiin
February 12, 2007 07:35PM

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.