mysql - any way to help fulltext search with another index?

青春壹個敷衍的年華 提交于 2019-12-03 16:51:30

Ok, so, since

Index Merge is not applicable to full-text indexes

http://dev.mysql.com/doc/refman/5.0/en/index-merge-optimization.html

I would try this approach: (replace author_id_index by the name of your index on author_id)

select * from articles use index (author_id_index)
where author_id=54 
and match (article_text) against ('foo');

Here the problem is the following:

  • it is indeed impossible to use a regular index in combination with a full-text index
  • if you join the table with itself, you are using an index already on each side of the join (the ON clause will use the author_id column, you definetly need the index here)

The most efficient has to be decided by you, with some test cases, whether using the author index is better than the text one.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!