optimize tables for search using LIKE clause in MySQL

后端 未结 4 606
一个人的身影
一个人的身影 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:08

    select * from emp where ename like '%e';
    

    gives emp_name that ends with letter e.

    select * from emp where ename like 'A%';
    

    gives emp_name that begins with letter a.

    select * from emp where ename like '_a%';
    

    gives emp_name in which second letter is a.

提交回复
热议问题