How REBUILD INDEX affects real-time statistics
Rebuilding an index has certain effects on the statistics for the index involved.
The table below shows how running REBUILD INDEX affects the SYSINDEXSPACESTATS statistics for an index space or physical index partition.
| Column name | Settings after BUILD phase |
|---|---|
| EXTENTS | Actual value |
| GETPAGES | 0 |
| NACTIVE | Actual value |
| NLEAF | Actual value |
| NLEVELS | Actual value |
| REBUILDLASTTIME | Current timestamp |
| REORGAPPENDINSERT | 0 |
| REORGDELETES | 0 |
| REORGINSERTS | 0 |
| REORGLEAFFAR | 0 |
| REORGLEAFNEAR | 0 |
| REORGMASSDELETE | 0 |
| REORGNUMLEVELS | 0 |
| REORGPSEUDODELETES | 0 |
| SPACE | Actual value |
| TOTALENTRIES | Number of index entries added1 |
Notes:
- Under certain conditions, such as a utility restart, the REBUILD utility might not have an accurate count of loaded records. In those cases, Db2 sets this value to null.
For a logical index partition, Db2 does not collect TOTALENTRIES statistics for the entire nonpartitioned index when it runs REBUILD INDEX. Therefore, Db2 does not reset the statistics for the index. The REORG counters from the last REORG are still correct. Db2 updates REBUILDLASTTIME when the entire nonpartitioned index is rebuilt.