關於反串連的實驗:not exists 和not in等都屬於反串連------------------------------------------------------------------------------實驗1:SQL> Explain plan for Select * from emp 2 where not exists 3 (Select * from dept where dept.deptno=emp.deptno) 4 ;
預存程序沒有執行計畫,查看的是預存程序中SQL語句的執行計畫,這裡用10046來看---------------------------------------------------- 建立預存程序Create Or Replace Procedure Lee_Xc(Eno Number) IsBegin Select Empno, Ename, Dname From Emp, Dept Where Emp.Deptno = Dept.Deptno And
原文地址:http://yangtingkun.itpub.net/post/468/499769經常看到有人提出這樣的疑問,我在同一張表上建立了多個索引,為什麼Oracle每次都選擇一個,而不能同時利用多個索引呢。一般來說,常見的訪問同一張表的兩個以上索引,存在三種情況,AND-EQUAL、INDEX HASH JOIN和BITMAP INDEX
Select Ci.Customer_Id, Ci.Customer_Name, Mc.Card_Id, t.Card_Type_Name, f_Getcustomercontactmeans(Ci.Customer_Id) As Cust_Contactmeans From v_Customer_Info Ci Inner Join t_Mc_Card_Used Mc On Mc.Card_Used_Id = (Select
最近遇到一個超超超爛的SQL,由於SQL涉及某某稅務局的資料,表名字是經過處理的。原始SQL如下:select * from ( select t.zxid,t.gh,t.xm,t.bm,t.fzjgdm, (select count(a.session_id) from test_v a where to_char(t.zxid) = a.ZCRYZH) slzl, (select count(a.session_id) from test_v a where
原始SQL,出來的資料為零行,這不是重點,統計資訊沒有到期,這裡不考慮統計資訊的問題 分別看下設計到表的行數 select count(*) from t_ho_room_price --3254605 select count(*) from t_ho_order_info --2034996 select count(*) from t_ho_order_statistics --2034996 Select count(*) from
select count(0) from creditguarantee cg where 1=1 and cg.createddate>=to_date('2012-02-23','yyyy-MM-dd') and cg.createddate<=to_date('2012-02-26','yyyy-MM-dd') and 2= (case when
index range scan(索引範圍掃描):1.對於unique index來說,如果where 條件後面出現了<,> ,between ...and...的時候,那麼就可能執行index range scan,如果where條件後面是=,那麼就會執行index unique scan。2.對於none unique index來說 如果where 條件後面出現了=,>,<,betweed...and...的時候,就有可能執行index range