Thursday 7 May 2015

Parallel rebuild of an Index findings

In a recent finding i saw that a index was rebuilt with below command :-

SQL>  select degree from user_indexes where index_name='IDX';

DEGREE
----------------------------------------
1

SQL> Alter index idx rebuild online parallel 4 ;

SQL>  select degree from user_indexes where index_name='IDX';

DEGREE
----------------------------------------
4

Now the problem is that this parallelism sticks to this index forever, now if you read from this index also it would be read in parallel resulting in so many parallel reads and resulting too much of CPU usage, this is what we saw recently as it was degrading our OLTP performance specially during peak hours.

So it is better always to revert back this setting to normal after every rebuild in order for index to behave and work in serial mode rather than parallel mode :-

Alter index idx noparallel ;

SQL>  select degree from user_indexes where index_name='IDX';

DEGREE
----------------------------------------
1

No comments:

Post a Comment