2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > mysql in 子查询优化_mysql in 子查询 容易优化

mysql in 子查询优化_mysql in 子查询 容易优化

时间:2022-09-03 14:32:36

相关推荐

mysql in 子查询优化_mysql in 子查询 容易优化

mysql in 子查询 简单优化 大数量下,不要使用 in 嵌套子查询,性能很差,很容易卡死。 ? 简单调整方式如下: select uid,nick_name from uc_users where uid in(select fid from uc_follow where uid=#uid#) ? 可拆解成: 1、select fid from uc_follow wher

mysql in 子查询 简单优化

大数量下,不要使用 in 嵌套子查询,性能很差,很容易卡死。

?

简单调整方式如下:

select uid,nick_name from uc_users where uid in(select fid from uc_follow where uid=#uid#)

?

可拆解成:

1、select fid from uc_follow where uid=#uid#

将1查出的结果,传给2

2、select uid,nick_name from uc_users where uid in($fids$)

?

发布php中文网,转载请注明出处,感谢您的尊重!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。