MySQL Forums
Forum List  »  Newbie

Optimising a String Matching query for Speed.
Posted by: Joey JJ
Date: June 17, 2014 03:05AM

Hello,

I'm trying to write a PROC that will be matching strings between tables.

At a most basic level it would look something like this

SELECT DISTINCT t.String
FROM TableOfStoredStrings t
JOIN AssortmentOfStrings s ON s.String = t.String

I will know the table of Stored Strings - as they will be previous written in the DB.

The second Table will be passed at Run Time. The table will have varying number of Rows (likely several thousand), and will be of varying length and will likely have duplicates.

Can anyone suggest how I might optimise this query for speed?

Should I convert the data type to a set length, e.g. varchar(100)

Will sorting both tables prior to running the above help?


Thanks for any help you can give.

Joey

Options: ReplyQuote


Subject
Written By
Posted
Optimising a String Matching query for Speed.
June 17, 2014 03:05AM


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.