一、查询原则

  1. 不要使用 select * from 查询整表字段,建议使用select id,name,address from user 方式查询;
  2. 如果id为主键,name字段是普通索引,使用like时,尽量使用后匹配,select * from user where name like 'name%' 或 select id,name from user where name like '%name%' 都可使用name字段索引;
  3. 使用select * from user where name like '%name%' 无法使用name索引;

相关文章:

  • 2022-02-04
  • 2021-06-13
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-12
  • 2021-05-18
  • 2021-11-14
  • 2022-02-13
  • 2022-02-09
相关资源
相似解决方案