锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产成人综合亚洲,亚洲国产精品无码第一区二区三区,国产日本亚洲一区二区三区http://m.tkk7.com/davma/articles/247373.htmldavmadavmaFri, 19 Dec 2008 09:26:00 GMThttp://m.tkk7.com/davma/articles/247373.htmlhttp://m.tkk7.com/davma/comments/247373.htmlhttp://m.tkk7.com/davma/articles/247373.html#Feedback0http://m.tkk7.com/davma/comments/commentRss/247373.htmlhttp://m.tkk7.com/davma/services/trackbacks/247373.html1 鏈変袱涓〃錛孉琛?00澶氫竾錛孊琛?00澶氫竾錛岃繖涓や釜琛ㄨ鍋氬叧鑱旀煡璇紝娌℃湁GROUP BY絳夋搷浣滐紝鍙槸鏅氱殑鏌ヨ錛屽浣曟彁楂橀熷害錛?/span>
[1]鎶婅兘闄愬埗鑼冨洿鏈灝忕殑鏉′歡鏀懼湪鏈鍓嶉潰,姝ゆ潯浠跺搴旂殑鍒楀姞涓涓嬬儲(chǔ)寮?br />
[2]灝介噺鎶奧here鍚庨潰緇欏嚭鐨勬潯浠舵墍瑕佺敤鐨勫瓧孌靛緩绔嬬儲(chǔ)寮?
閬垮厤浣跨敤like, 閬垮厤鍦╳here涓嬌鐢╥s null鎴栬卛s not null,
鍙﹀,鍏堣闄愬埗浠庝袱寮犺〃鍙栫殑鏁版嵁,鏈鍚庢墠鍐欎袱琛ㄥ叧鑱旂殑瀛楁(涓よ〃榪炴帴鐨勬潯浠?
[3]绱㈠紩鏄彁鍗囬熷害鐨勫叧閿傚彲浠ヨ冭檻鍒嗘垚鍑犱釜鏌ヨ錛屾瘡涓煡璇㈠搴斾竴涓渶浣崇殑绱㈠紩
[4]寮哄埗绱㈠紩錛涘皯鐢↖N錛岀敤EXISTS錛涘彲浠ョ殑璇濓紝澶氬緩涓存椂琛紱
[5]鎶鏈笂鎻愰珮鏌ヨ鍔炴硶錛氬緩绔嬪悎閫傜殑绱㈠紩錛岄伩鍏嶇敤褰卞搷鏌ヨ閫熷害鐨勬潯浠?姣斿in銆?絳夛紝濡傛灉鍙互浣減artition鐨勶紝灝變綔partition錛屽敖閲忓垎孌墊煡璇€?br />
涓や釜澶ц〃鍏寵仈鏌ヨ錛屽睘浜庝笟鍔¢棶棰橈細(xì)鏁版嵁閲忓法澶э紝鏈韓灝辨槸寰堣垂鏃墮棿鐨勪簨銆傚儚縐誨姩銆佺數(shù)淇★紝鍩烘湰涓婁笉緇欐墦鍗?騫寸殑甯愬崟錛屽氨鏄伩鍏嶆暟搴﹀お鎱㈠獎(jiǎng)鍝嶄笟鍔°?br />
[6]鍏抽敭鐪嬩綘鍋氫粈涔堟牱鐨勫叧鑱旀搷浣滐紝where鏉′歡寰堥噸瑕侊紙鏄惁鐢ㄤ簡(jiǎn)in/not in,like絳夋潯浠訛級(jí)錛岃繕鏈夋槸鍚︾敤浜?jiǎn)union錛堝洜涓簎nion all 鐨勬墽琛岃姣攗nion蹇緢澶氾級(jí)
[7]鍏抽敭瀛楀緩绔嬬儲(chǔ)寮?br />
ID閲囩敤LONG鍨嬭屼笉閲囩敤varchar,瀵逛簬嫻烽噺鏁版嵁鐨勬煡璇㈠彲浠ユ彁閫熷緢澶?br />
鍏跺畠鐨?鏈夊緟妤間笅榪涗竴姝ユ彁渚?br />
[8]琛ㄧ┖闂村垎閰嶅悎鐞?鍥炴粴孌電┖闂村垎閰?50M宸﹀彸
[9]寤虹珛绱㈠紩涔嬪悗 鍒嗘壒鏌ヨ
[10]浼樺寲鏌ヨ鏉′歡,搴旇鏄瘮杈冨疄闄呯殑鍔炴硶,灝嗚繑鍥炵殑緇撴灉緙╁皬鍦ㄦ渶灝忕殑鑼冨洿鍐呯殑鏌ヨ鏀懼埌鍓嶉潰,渚濇
[11]搴斿厛榪涜琛ㄧ┖闂寸殑浼樺寲錛屽洖婊氭鐨勪紭鍖栵紝绱㈠紩浼樺寲錛屽啀榪涜鏌ヨ璇彞鐨勪紭鍖?br />
濡傛灉榪樻槸涓嶈鍙瘯璇曞緩涓鍥撅紝寤虹珛瑙嗗浘蹇収 2 Transitive predicate generation
濡傛灉鎯蟲(chóng)煡鍑烘煇涓孌墊椂闂寸殑鏈夋晥鐨勫崟鎹腑錛堟垨鑰呮煇浜涗駭鍝侊級(jí)鐨勬槑緇嗚祫鏂欙紝涓鑸殑鍋氭硶錛?br />
select 鎵闇瀛楁
from detail_tab a,main_tab b
where a.prod_id = b.prod_id
and a.yyyymmdd = b.yyyymmdd
and a.paper_no = b.paper_no
and a.io = b.io
and b.yyyymmdd = 鎸囧畾鏃ユ湡
and a.io = 榪涗粨
and b.code = 鏈夋晥鐨?
榪欎釜鏌ヨ鐨勯熷害浼?xì)鍥犱给櫩欎袱涓〃杩囦簬宸ㄥぇ鑰岄潪甯哥殑緙撴參錛?銆銆銆
鐜板湪鏈変竴涓В鍐沖姙娉曪紝灝辨槸緇欎袱涓〃閮藉姞涓婃潯浠訛紝鍗充嬌鏄袱涓〃鍏寵仈鐨勫瓧孌典篃鍔狅細(xì)
select 鎵闇瀛楁
from detail_tab a,main_tab b
where a.prod_id = b.prod_id
and a.yyyymmdd = b.yyyymmdd
and a.paper_no = b.paper_no
and a.io = b.io
and b.yyyymmdd = 鎸囧畾鏃ユ湡
and a.yyyymmdd = 鎸囧畾鏃ユ湡
and a.io = 榪涗粨
and b.io = 榪涗粨
and b.code = 鏈夋晥鐨?
榪欐牱鐨勯熷害瑕佹瘮鍓嶄竴縐嶅揩浜?jiǎn)鑷碁?0鍊嶄互涓娿?br />
浜哄伐璋冧紭錛岀壒鍒浜庣儲(chǔ)寮曪紝鏉′歡欏哄簭銆?br />
3
http://www.componentace.com/help/absdb_manual/increasesqlperformance.htm
Absolute Database search and filter optimizations are based on the use of available indexes.
Always create unique (primary) indexes when possible, as the unique index allow much better optimization then non-unique index.
To improve peformance of a LIKE condition, you can create an appropriate index, but note that this index can improve performance for patterns like 'str%' only銆?br />
Available indexes for JOIN conditions銆俆o improve a JOIN query, please check that each field from JOIN conditions has an index.
Rewriting query with OR conditions as a UNION
Available indexes for ORDER BY clause If you want to speed up a "live" SELECT from a single table with ORDER BY clause, you can create a compound index for ORDER BY fields.
Available indexes for GROUP BY clause銆俆o get a better performance for SELECT from a single table with GROUP BY clause, you can create a compound index for GROUP BY fields.
Select from in-memory tables銆俌our query perofrmance could be increased also if you will move all data from disk tables to in-memory tables and you will perform a query using in-memory copies of the disk tables
4
The fastest way of inserting and updating
The fastest way of batch inserting / updating / deleting is a buffered transaction.
We recommend to call TABSDatabase.StartTransaction before bulk inserts and
TABSDatabase.Commit(False) after the end of the batch operation. The use of transaction can significantly increase performance of the batch operation
How to speed up an UPDATE query
If you are using several subqueries in an UPDATE query, you could try to transform your query like pair values, not separated.
5
Common subexpression elimination
Subquery “flattening”
Complex/simple view merging
Predicate pushdown and pullup
OR-expansion 絳夌瓑銆傝繖浜涘弬鑰僪ttp://www.oracle.com/technology/products/bi/db/10g/pdf/twp_general_query_optimization_10gr2_0605.pdf
鎬諱箣鏌ヨ棣栧厛鑰冭檻鏌ヨ鑷韓鐨勪紭鍖栵紝灝嗚褰曟暟灝藉彲鑳藉噺灝戯紝鍗硍here鏉′歡瑕佸敖鍙兘鍏呭垎錛堢壒鍒敞鎰忓彲鎺ㄥ鍜岄噸澶嶇殑鍖哄埆錛夛紝鎶曞獎(jiǎng)浼樺厛浜庤仈鎺ワ紝鏃跺埢浠ュ噺灝戣仈鎺ユ暟涓哄垎鏋愮殑涓昏鍘熷垯銆傜劧鍚庢槸瀵圭儲(chǔ)寮曠殑鍒嗘瀽銆傝嚦浜庨噺鍖栧垎鏋愶紝鍒欐槸瀵瑰縐嶇瓥鐣ョ殑璇勪環(huán)鐨勭洿鎺ユ柟娉曘?