Roy
Roy

Reputation: 987

Improving a mysql simple text search for a one-word column

I have a one-word column with about 10000 rows. Searching for a certain word is ok but should be faster - right now I'm using

SELECT * FROM words WHERE word='hello'

This query takes 0.0004 secs to be exec.

I've created a FULLTEXT on the word column, but the time for the query to exec is exactly the same. What would you do?

Upvotes: 0

Views: 256

Answers (2)

Andreas Wederbrand
Andreas Wederbrand

Reputation: 40041

There is no gain in a FULLTEXT index if it's only one world. That is used to index parts of larger texts so that they can be searched.

I assume you already have a normal index on word. You could experiment with setting the length of the index but it might not improve.

Upvotes: 0

Victor Parmar
Victor Parmar

Reputation: 5789

SELECT * FROM words WHERE MATCH (word) AGAINST ('hello')

For more info: http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html

Upvotes: 1

Related Questions