$sql = "select * from pre_common_member_profile as p where destination = '{$user['destination']}' and p.uid <> {$uid} and p.uid > {$huid} and gender = {$displaygender} and uid not in(select fuid from pre_home_friend where uid={$uid}) order by uid";怎么优化一下这条查询语句,是不是效率太低了?请大神赐教~~~~
解决方案 »
- mysql 无故服务停止 报错!请高手解答
- 单表goods,260w数据,key_buffer_size目前为8mb,感觉好像少了
- 一个问题
- 看到一些mysql数据库的性能标志,qps、tps、IOPS,从哪里获取这些值呢?
- sql 要优化了了。。。。。
- 【百度分享】MySQL 5.1分区技术初探(一)
- <<<<<<<<<<<<<<求一个sql语句>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- mysql union 与union all 使用
- 请教在jbuilder中如何连接mysql数据库
- MySQL获取锁失败求解-Lock wait timeout exceeded; try restarting transaction
- mysql密码自己变动
- mysql 触发器插入数据可以,update前后的insert都执行了,但是update没有反应
explain select ...
show index from ..
以供分析。
2、把not in的子查询转换为left jion
3、建议看一下执行计划,看看是否需要索引方面的优化