文章详情
【mysql】提高mysql模糊查询速度
发布时间:2022-01-17
沉默小管-技术博客
【mysql】提高mysql模糊查询速度
1141
2
原文地址:
https://www.php-china.com//detail/98
H1
H2
H3
H4
H5
H6
## LIKE 我们正常情况一般都是通过like进行模糊查询比如 ```bash select username,password,sex,age from user_info where username like '你很牛掰哦' ``` ## INSTR() 但是今天我查了下mysql的资料发现居然还有个更牛掰的mysql的函数instr() instr()是通过字符串中查找子字符串或检查字符串中是否存在子字符串 //str是要搜索的字符串。 //substr是要搜索的子字符串。 instr(str,substr) ```bash select username,password,sex,age from user_info where instr(username,'你很牛掰哦')>0 ``` like模糊查询和instr查询,**instr更加快些**。具体原因俺也不知道,有懂的大佬多多指教 参考网站:[https://www.yiibai.com/mysql/instr.html](https://www.yiibai.com/mysql/instr.html)
上一篇
下一篇
收藏
支持
标签:
最新文章
统计信息
联系站长
加入技术群
日志总数:92篇
网站运行:1424天
累计访客:13007
热门文章
1. PHP基础概念
2. redis:ERR AUTH <password> called without any password configured for the default user解决办法
3. PHP的语言结构之包含文件
4. PHP中public,private,protected的区别
5. PHP魔术方法总结
6. php如何转换json格式中的中文
7. PHP7新特性(常用)
8. PHP7上项目报错A non-numeric value encountered解决办法
9. 运行golang出现invalid memory address or nil pointer dereference错误
10. git常用命令集合