I need to find text (about 500 words) for words in an English dictionary (about 275,000 keywords) English words and right now the query I'm using is not really optimized, it takes more than 10 seconds to complete (there is a table of words and texts table):
SELECT word FROM words WHERE 'The quick brown fox jumps over the lazy dog' LIKE CONCAT( '%', word, '%' );
Got an idea here .
I already set the word field as an index and saw some examples of people who store text in a database or put it directly in a query.
Other examples showed that people using FULLTEXT search, although they have 300 thousand words, I don’t think that FULLTEXT will work, I think it’s good to search with +brown +lazy -apple , but in my case I don’t need much logic.
Another example I saw is to comment on words with the IN (...) clause IN (...) , although with 500 m keywords the query will be insanely long.
Any ideas what to do?
Right now the text is saved as a text field and words like varchar(50) in InnoDB encoded with utf8_unicode_ci , I heard that InnoDB is slow, so I can use MyISAM or any other. I am using MySQL 5.5, although I could upgrade to 5.6 if that helped.
source share