-
December 8th, 2007, 07:51 AM
#1
[MySQL] Optimizing Full-Text Search
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|