2
votes

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?

1
so its means there is data difference of each keywordMuhammad Muazzam
@MuhammadMuazzam 4 queries have same resulthoangvu68

1 Answers

0
votes

I found a answer. That is because number of results of each keyword. We should put the keyword has small result on the top.