1.默认全连接
create table tab_big as select * from dba_objects where rownum<=30000; create table tab_small as select * from dba_objects where rownum<=10; set autotrace traceonly set linesize 1000 set timing on select count(*) from tab_big,tab_small ; //两个表的顺序与查询速度无关 select count(*) from tab_small,tab_big ;
select * from t1,t2 where t1.object_id=29 and t2.data_id>8;//查询条件顺序与查询速度无关
select * from t1,t2 where t2.data_id>8 and t1.object_id=29
本文介绍了在Oracle数据库中进行SQL查询优化的方法,通过对比不同表连接顺序和查询条件顺序的效果,说明了这些因素对查询速度的实际影响。实验证明,表的顺序与查询速度无关,而查询条件的顺序也不影响查询效率。
822

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



