It has been a pain on my head for the past few days. I created the database before without knowing about LIKE performance. The query I used is as follows:
SELECT .... FROM .... JOINS .... WHERE tableA.col1 LIKE '%keyword%' OR tableB.col2 LIKE '%keyword%' OR tableC.col2 LIKE '%keyword%' OR .....
When I tested the query, it was very fast because it only had about 100-150 records. I wanted to find any string containing a keyword. After several months, the database grew enormous, containing 50,000 records. And this time I am already experiencing poor query performance. It was extremely low.
Any suggestions how I can improve it? I cannot change the database because it has already been used by the corporation.
By the way, my tables were INNODB .
source share