If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > I'm looking for the best way to join two tables based on the matching of the words in a varchar field in one table against a varchar field on another table

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-30-09, 17:23
egrinblat egrinblat is offline
Registered User
 
Join Date: Jun 2009
Posts: 1
I'm looking for the best way to join two tables based on the matching of the words in a varchar field in one table against a varchar field on another table

I have two tables with a description column in each one. The first table may have between 500,000 and 1,000,000 records, the second one may have between 1,000 and 10,000 records. I need to get the join of both tables based on the descriptions fields in each table but the problem is I should search the words in the descriptions fields in any order. For example "My house is red" should join with "Red is my house" or with "is red my house". So the words in the description field on the first table should be the same to the words in the description field on the second table without considering the order of those words.
I could create in both tables 7 or 8 varchar fields (the descriptions are never longer than 8 words) to store all the words from the descriptions fields of both tables if it could help.
How can I solve this with a good performance?
Reply With Quote
  #2 (permalink)  
Old 06-30-09, 22:02
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 384
fulltext index with boolean search
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On