日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle cost cardinality,ORACLE 执行计划中cost cardinality bytes cpu_cost io_cost解释

發(fā)布時間:2025/3/21 编程问答 51 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle cost cardinality,ORACLE 执行计划中cost cardinality bytes cpu_cost io_cost解释 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

從網(wǎng)上找到的資料,加上我在文檔中查到的內(nèi)容:

■ Cost The cost assigned to each step of the query plan by the CBO. The CBO works by

generating many different execution paths/plans for the same query and assigns a cost to

each and every one. The query plan with the lowest cost wins. In the full outer join example,

we can see the total cost for this query is 10.

■ Card Card is short for Cardinality. It is the estimated number of rows that will flow out

of a given query plan step. In the full outer join example, we can see the optimizer expects

there to be 327 rows in EMP and 4 rows in DEPT.

■ Bytes The size in bytes of the data the CBO expects each step of the plan to return.

This is dependent on the number of rows (Card) and the estimated width of the rows.

·Cardinality是指計劃中這一步所處理的行數(shù),實際是一個估算值,不準確。

·cost指cbo中這一步所耗費的資源,這個值是相對值,和cpu_cost、io_cost是有關(guān)系的。

參考《Apress.Troubleshooting.Oracle.Perforamnce》,chapter 4 system and object statistics。

cpu_cost=column_position*20(this formular is used to compute the cpu cost of accessing a column)

cost是由其他幾個因素共同決定的,這里暫時不進行深入的研究。

一般情況下,在一張表只有一條記錄的情況下,cpu_cost會有個初始值(常見的是2萬多或3萬多),隨著記錄的增加,cpu_cost也成比例的增加。

對于io_cost來說,如果訪問的記錄在一個db_block中,值是不變的。

·bytes指cbo中這一步所處理所有記錄的字節(jié)數(shù),是估算出來的一組值。

需要注意的是,在表記錄數(shù)變更后,如果不執(zhí)行DBMS_STATS.gather_table_stats統(tǒng)計的話,得到的cost等指標是不變的,也就是不準確的,只有重新統(tǒng)計一下表后,才能正確反應(yīng)耗費的成本。

一般的,造成速度問題的,大多是I/O問題引起的,降低磁盤IO,增加緩存效率,是優(yōu)化的基本技術(shù)

總結(jié)

以上是生活随笔為你收集整理的oracle cost cardinality,ORACLE 执行计划中cost cardinality bytes cpu_cost io_cost解释的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。