Hi,

i have a database, for my web application, that has a very large table with one half million rows and destined to grow up to 2 millions.

There is a column 'name' of type LONGTEXT, in which the strings could have up to 200-300 characters, and i intend to query this table with text searches like these :

Code:
SELECT * FROM table WHERE name LIKE '%substring1%';

and also with more than one substring to search :

SELECT * FROM table WHERE name LIKE '%substring1%substring2%substring3%'; .. ecc.
The execution time of these queries is almost always over 1 minute, and i can't accept it because the maximum execution time for a PHP script is 30 seconds..

How i could optimize these queries??
Using normal indexes won't help because they simply do an alphabetical ordering of the names , that would be good for searching the full name, but not for searching substrings.

Thank you in advance.