MySQL Forums
Forum List  »  Optimizer & Parser

substr, update, index wont like each other
Posted by: Pavan Kumar
Date: May 15, 2008 12:58PM

update table1 b set b.column_id1 = (select a.column_id1 from table2 a where substr(a.column2_id,1,9)=substr(b.column2_id,1,9));

This query takes a long time (over 600 sec) even after indexing all (tried almost all indexing possibilities) the involved columns.

table1 total rows: 40K
table2 total rows: 10K

Please help me get this query speed up.

Thank you in advance.

Options: ReplyQuote


Subject
Views
Written By
Posted
substr, update, index wont like each other
7972
May 15, 2008 12:58PM


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.