偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

簡單介紹Oracle驅(qū)動表

數(shù)據(jù)庫 Oracle
這里介紹Oracle驅(qū)動表,實際上在CBO中,如果有統(tǒng)計數(shù)據(jù)(即對表與索引進行了分析),則優(yōu)化器會自動根據(jù)cost值決定采用哪種連接類型,并選擇合適的Oracle驅(qū)動表,這與where子句中各個限制條件的位置沒有任何關(guān)系。

Oracle有很多值得學習的地方,這里我們主要介紹Oracle驅(qū)動表,包括介紹hints的用法等方面。CBO根據(jù)統(tǒng)計信息選擇Oracle驅(qū)動表,假如沒有統(tǒng)計信息,則在from 子句中從左到右的順序選擇Oracle驅(qū)動表。這與RBO選擇的順序正好相反。這是英文原文(CBO determines join order from costs derived from gathered statistics. If there are no stats then CBO chooses the driving order of tables from LEFT to RIGHT in the FROM clause. This is OPPOSITE to the RBO) 。

我還是沒法證實這句話的正確性。不過經(jīng)過驗證:“如果用ordered 提示(此時肯定用CBO),則以from 子句中按從左到右的順序選擇Oracle驅(qū)動表”這句話是正確的。實際上在CBO中,如果有統(tǒng)計數(shù)據(jù)(即對表與索引進行了分析),則優(yōu)化器會自動根據(jù)cost值決定采用哪種連接類型,并選擇合適的Oracle驅(qū)動表,這與where子句中各個限制條件的位置沒有任何關(guān)系。如果我們要改變優(yōu)化器選擇的連接類型或Oracle驅(qū)動表,則就需要使用 hints了,具體hints的用法在后面會給予介紹。

如果我創(chuàng)建的3個表:

  1. create table A(col1 number(4,0),col2 number(4,0), col4 char(30));  
  2. create table B(col1 number(4,0),col3 number(4,0), name_b char(30));  
  3. create table C(col2 number(4,0),col3 number(4,0), name_c char(30));  
  4. create index inx_col12A on a(col1,col2); 

執(zhí)行查詢:

  1. select A.col4  
  2. from B, A, C  
  3. where B.col3 = 10 
  4. and A.col1 = B.col1  
  5. and A.col2 = C.col2  
  6. and C.col3 = 5;  
  7. Execution Plan 

【編輯推薦】

  1. 討論Oracle文檔學習經(jīng)驗
  2. 如何了解Oracle生成執(zhí)行計劃
  3. 詳細談?wù)揙racle表連接
  4. 分析Oracle索引掃描四大類
  5. 高手閑談Oracle索引掃描
責任編輯:佚名 來源: 博客
相關(guān)推薦

2009-10-20 18:30:03

Oracle查找用戶表

2010-10-29 10:22:21

Oracle表空間

2010-04-28 18:49:10

Oracle臨時表

2011-08-11 16:08:55

Oracle數(shù)據(jù)庫ASHAWR

2009-07-07 11:38:54

jsp oracle

2010-04-29 13:53:42

Oracle臨時表

2011-07-28 17:45:59

UTL_INADDRoracle

2011-02-22 16:38:03

Konqueror

2011-01-21 18:08:22

Qmail

2011-04-01 09:39:17

zabbix

2011-03-29 09:14:37

2011-03-04 13:19:09

VSFTP介紹

2009-06-17 17:59:01

介紹Spring

2011-01-21 16:49:15

Zimbra

2011-01-21 10:40:52

Sendmail

2011-02-24 14:40:47

Proftpd

2011-02-23 13:28:12

2011-03-22 14:49:35

Oracle數(shù)據(jù)庫重定義表

2011-08-12 12:59:33

Oracle數(shù)據(jù)庫同義詞

2010-10-29 15:54:13

Oracle后臺進程
點贊
收藏

51CTO技術(shù)棧公眾號