执行计划里面的FILTER 与 NESTED LOOPS 有什么区别
1个回答
展开全部
select * from xa
where a >= all(select e from xb)
with the following Plan:
[-] SELECT STATEMENT CHOOSE Cost = 3802 (Cost = 3802 Cardinality = 95 Bytes = 1140 )
[-] FILTER ( )
[ ] TABLE ACCESS FULL SQLEXPS.XA ANALYZED (Cost = 2 Cardinality = 95 Bytes = 1140 )
[ ] INDEX FULL SCAN SQLEXPS.XB_INX ANALYZED (Cost = 40 Cardinality = 819 Bytes = 5733 )
The way Oracle perform to search data is:
Performs a filter operation. It accepts row sources from XA Full Scan, eliminates rows from XB Index Full Scan and returns the remaining rows from XA Full Scan to the user or application issuing the statement.
Nested Loops is used to find matched rows from A table(normally full scan or index range scan) to index scan B table. There is no definite answer which is better, since normally it cannot replace each other unless you rewrite your SQL in significant differently syntax.
where a >= all(select e from xb)
with the following Plan:
[-] SELECT STATEMENT CHOOSE Cost = 3802 (Cost = 3802 Cardinality = 95 Bytes = 1140 )
[-] FILTER ( )
[ ] TABLE ACCESS FULL SQLEXPS.XA ANALYZED (Cost = 2 Cardinality = 95 Bytes = 1140 )
[ ] INDEX FULL SCAN SQLEXPS.XB_INX ANALYZED (Cost = 40 Cardinality = 819 Bytes = 5733 )
The way Oracle perform to search data is:
Performs a filter operation. It accepts row sources from XA Full Scan, eliminates rows from XB Index Full Scan and returns the remaining rows from XA Full Scan to the user or application issuing the statement.
Nested Loops is used to find matched rows from A table(normally full scan or index range scan) to index scan B table. There is no definite answer which is better, since normally it cannot replace each other unless you rewrite your SQL in significant differently syntax.
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询