最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Oracle中檢查是否需要重構(gòu)索引的sql

 更新時(shí)間:2013年08月08日 16:49:11   作者:  
經(jīng)常需要在Oracle中檢查是否需要重構(gòu)索引,在此寫(xiě)了個(gè)示例語(yǔ)句,有此需求的朋友可以參考下,希望對(duì)大家有所幫助
復(fù)制代碼 代碼如下:

SELECT
height, /*Height of the B-Tree*/
blocks, /* Blocks in the index segment */
name, /*index name */
lf_rows, /* number of leaf rows in the index */
lf_blks, /* number of leaf blocks in the index */
del_lf_rows, /* number of deleted leaf rows in the index */
rows_per_key /* average number of rows per distinct key */
blk_gets_per_access /* consistent mode block reads (gets) */
FROM INDEX_STATS
WHERE NAME='INDEX_NAME';

復(fù)制代碼 代碼如下:

ANALYZE index INDEX_NAME VALIDATE STRUCTURE


HEIGHT:
This column refers to the height of the B-tree index, and it's usually at the 1, 2, or 3 level.
If large inserts push the index height beyond a level of 4, it's time to rebuild, which flattens the B-tree.

DEL_LF_ROWS:
This is the number of leaf nodes deleted due to the deletion of rows.
Oracle doesn't rebuild indexes automatically and, consequently, too many deleted leaf rows can lead to an unbalanced B-tree.

BLK_GETS_PER_ACCESS:
You can look at the BLK_GETS_PER_ACCESS column to see how much logical I/O it takes to retrieve data from the index. If this row shows a double-digit number, you should probably start rebuilding the index.

相關(guān)文章

最新評(píng)論

密山市| 永胜县| 会东县| 湟源县| 滦平县| 邮箱| 昌平区| 邳州市| 刚察县| 绥化市| 宣武区| 康平县| 湄潭县| 宁陵县| 德格县| 宁波市| 正宁县| 辽宁省| 遂宁市| 东乡| 长丰县| 罗平县| 徐州市| 昔阳县| 青冈县| 普陀区| 涿鹿县| 乐亭县| 正蓝旗| 雷波县| 清镇市| 寿光市| 内乡县| 翁牛特旗| 敦化市| 阿合奇县| 中阳县| 合江县| 三门县| 荥经县| 双江|