Hi
I'm building a small search engine for my table.
While I'm looking for words in 5 VARCHAR fields, is it better to request:
**
SELECT * FROM table WHERE '%word1%' LIKE field1 OR '%word2%' LIKE field1 OR '%word1%' LIKE field2 OR '%word2%' LIKE field2 ... etc... OR '%word2%' LIKE field5
(this request in generated by a for() loop, and this example contains only 2 query words; imagine when there are 5 or 6 !!)
or
**
SELECT * FROM table WHERE (word1|word2) REGEXP field1 .....etc... (word1|word2) REGEXP field5
?
While the first request is veeeeeeeeeeeeery long, the second with 5 REGEXP may take lot of process time, uh ?
Thank you for your advises.