optimize tables for search using LIKE clause in MySQL

后端 未结 4 611
一个人的身影
一个人的身影 2021-01-15 03:10

I am building a search feature for the messages part of my site, and have a messages database with a little over 9,000,000 rows, and and index on the sender,

4条回答
  •  无人及你
    2021-01-15 04:13

    If you want to stick with using MySQL, you should use FULL TEXT indexes. Full text indexes index words in a text block. You can then search on word stems and return the results in order of relevance. So you can find the word "example" within a block of text, but you still can't search efficiently on "xampl" to find "example".

    MySQL's full text search is not great, but it is functional.

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

提交回复
热议问题