Friday, May 8, 2015

Rebuild index



what is difference between rebuilding of indexes using reorg command and load command?

Two ways for rebuilding indexes: 
1) Reorg Indexes for all table tablename 
2) Load from /dev/null of del insert into tablename indexing mode rebuild
 

What is the difference between the above two? 

Rebuilding indexes using Load should be faster than Re-org indexes command. 

Observation 1: 
SORT Phase is running parallel in Load command. verify with db2pd -sort and -reorg index options. The output indicates two sort memory areas allocated and performed. 

Observation 2: 
SORT Phase is running one after another in REORG INDEXES ALL FOR TABLE command. The output of db2pd -sort and -reorg index options indicates one sort operation after another performed. 

> intra-parallel mode(CFG setting is NO) and running shared sorts only.