找cid 为1 2 3 中相同的ROWKEY
或是CID 为1 2 3 4 5 这样的多个的,可以写为
select rowkey from conditionresult_tab where cid=1 and rowkey in
(select rowkey from conditionresult_tab where cid=2 and rowkey in
(select rowkey from conditionresult_tab where cid=3))
,就是一个子查询,查询交集的,这样的SQL语句有什么优化方法呢?
现在这样的查询速度特别慢
或是CID 为1 2 3 4 5 这样的多个的,可以写为
select rowkey from conditionresult_tab where cid=1 and rowkey in
(select rowkey from conditionresult_tab where cid=2 and rowkey in
(select rowkey from conditionresult_tab where cid=3))
,就是一个子查询,查询交集的,这样的SQL语句有什么优化方法呢?
现在这样的查询速度特别慢
本文讨论了针对复杂的SQL查询语句进行优化的方法,特别是对于需要多次嵌套查询来获取相同ROWKEY或CID的情况。当前的查询方式运行速度较慢,因此探讨了可能的改进措施。

被折叠的 条评论
为什么被折叠?



