mysql数据库优化
来源:互联网 发布:湖北大学知行学院几本 编辑:程序博客网 时间:2024/05/16 04:45
in (select xxx)
优化前(用时0.8s)
update tb_statistics set count=count+1, created=now() where entity='User' and linked_id in (select action.user_id AS id from tb_action action where action.id=10686 and action.status=1) and linked_id<>1372 and (type = ('my_activity'));优化后(用时0.05s)
update tb_statistics, (select action.user_id AS id from tb_action action where action.id=10686 and action.status=1) AS b set count=count+1, created=now() where entity='User' and linked_id=b.id and linked_id<>1372 and (type = ('my_activity'));
优化说明:请不用使用in (select xxx)查询。
0 0
- MYSQL数据库查询优化
- mysql数据库优化
- MySQL数据库优化
- mysql数据库优化(转)
- 优化 MySQL 数据库
- 优化MySQL数据库查询
- MySQL数据库优化五步走
- 优化MySQL数据库查询
- 优化MySQL数据库查询
- 优化MySQL数据库查询
- Mysql数据库优化配置
- MySQL数据库优化--SQL
- 优化mysql数据库方法
- 数据库优化之MySQL
- MYSQL数据库的优化
- mysql数据库优化五步走
- MySQL 数据库性能优化
- mysql数据库优化五步走
- 传说中的ACM大牛!!!
- Android应用启动后自动创建桌面快捷方式
- Python版简易计算器的实现
- RFC6455-The WebSocket protocol 之五:Opening Handshake 4.2-4.4
- SGU 104 DP
- mysql数据库优化
- Flex Alert.show()方法的详解
- iOSAPNS
- 举例证明有理数不能完整的建立度量理论基础
- vmware安装ubuntu系统时不能看到共享文件的问题
- 黑马程序员-java网络编程
- ★★ 总结:获取 Iframe内的元素对象,兼容ie、firefox
- VC基于单文档opengl框架
- MapReduce原理