The performance of mysql fulltext depend on order of keyword
1
vote
1
answer
930
views
I am having problem with mysql fulltext search. When I change the order of keyword, the search speed changes. For example I have 4 queries, all of them return same result:
1. FAST (1s)
SELECT *
FROM table
WHERE (MATCH (column_data) AGAINST('+english* +php*' IN BOOLEAN MODE)
2. SLOW (10s)
SELECT *
FROM table
WHERE MATCH (column_data) AGAINST('+php* +english*' IN BOOLEAN MODE)
3. FAST (1s)
SELECT *
FROM table
WHERE MATCH (column_data) AGAINST('+php*' IN BOOLEAN MODE)
AND (MATCH (column_data)) AGAINST('+english*' IN BOOLEAN MODE))
4. SLOW (10s)
SELECT *
FROM table
WHERE (MATCH (column_data) AGAINST('+english*' IN BOOLEAN MODE))
AND (MATCH (column_data) AGAINST('+php*' IN BOOLEAN MODE))
How can I optimize it?
Asked by hoangvu68
(111 rep)
May 29, 2017, 07:49 AM
Last activity: Apr 25, 2025, 01:08 AM
Last activity: Apr 25, 2025, 01:08 AM