optimize tables for search using LIKE clause in MySQL

后端 未结 4 613
一个人的身影
一个人的身影 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-15 03:58

    '%EXAMPLE_QUERY%'; is a very very bad idea .. am going to give you some

    A. Avoid wildcards at the start of LIKE queries use 'EXAMPLE_QUERY%'; instead

    B. Create Keywords where you can easily use MATCH

提交回复
热议问题