enq: TX - index contention等待事件

enq: TX - index contention常由 大量併發INSERT 造成的 index split 引起。下面截取部分有問題的
awr:
 
 
 
可以看到在awr中 發生過 3412次的 index leaf block split , 15次的branch block split 
 
建議:

1. 定期對 DLog 相關的索引執行 coalesce 操作 而非 rebuild 操作。 rebuild 可能導致索引高度下降,當再有 大量插入後可能會導致索引root node split

2. 分區表的話,考慮使用global hash index ,global hash index可以很大程度上避免索引插入爭用。
 
SQL> analyze index business.PK_TINSURED validate structure;

Index analyzed.

SQL> select blocks,lf_blks,del_lf_rows from index_stats;

    BLOCKS    LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
    219608     213822         334

SQL> alter index business.PK_TINSURED coalesce;

Index altered.

Elapsed: 00:01:56.97

SQL> analyze index business.PK_TINSURED validate structure;

Index analyzed.

Elapsed: 00:00:27.93
SQL> select blocks,lf_blks,del_lf_rows from index_stats;

    BLOCKS    LF_BLKS DEL_LF_ROWS
---------- ---------- -----------
    219608     165849           0

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章