新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
Oracle查詢記錄相關(guān)效率的查詢
以下的文章主要是對(duì)Oracle 查詢記錄是否真正存在的相關(guān)效率問題的介紹,由于我最近要對(duì)Oracle數(shù)據(jù)庫(kù)的效率進(jìn)行優(yōu)化,所以在一些信譽(yù)度比較好的網(wǎng)上查詢了很多關(guān)于判斷記錄是否存在的高效率方法。

網(wǎng)上有很多的建議***種方法,我做了一個(gè)測(cè)試,但是可能數(shù)據(jù)量不夠大,42667條記錄,不知道很大的數(shù)據(jù)量是什么一個(gè)情況,網(wǎng)上好多高效的建議方式
- select * from item where item='1B241371X0021' and rownum<2;
但是我測(cè)試的結(jié)果:
- select * from item where item='1B241371X0021' and rownum<2;
- 1 rows selected in 0.047 seconds
count(*) 方式
- select count(*) from item where item='1B241371X0021';q
- 1 rows selected in 0.016 seconds
exists方式
- select count(*) from dual where exists(select 1 from item where item='1B241371X0021');
- 1 rows selected in 0.015 seconds
從測(cè)試的結(jié)果看,后兩種方式比前一種方式的效率明顯要高.以上的相關(guān)內(nèi)容就是對(duì)Oracle 查詢記錄是否存在的效率問題的介紹,望你能有所收獲。
【編輯推薦】
- Oracle遠(yuǎn)程復(fù)制和異地容災(zāi)的3種解決方案介紹
- Oracle數(shù)據(jù)庫(kù)保持其優(yōu)良性的手段有哪些
- 九大Oracle性能優(yōu)化基本方法詳解
- Oracle數(shù)據(jù)庫(kù)的四種實(shí)用性很強(qiáng)的啟動(dòng)方式
- Oracle 11g中***有獨(dú)特點(diǎn)的5大特點(diǎn)
網(wǎng)站題目:Oracle查詢記錄相關(guān)效率的查詢
標(biāo)題路徑:http://m.fisionsoft.com.cn/article/cdjdedc.html


咨詢
建站咨詢
