urn:lsid:ibm.com:blogs:entries-b87f43b8-8a92-4961-a5bb-c3e6edf5f06eNews and information from the DB2 LUW Technical support team. - Tags - tables News and information from the DB2 LUW Technical support team.03012017-10-23T08:48:31-04:00IBM Connections - Blogsurn:lsid:ibm.com:blogs:entry-11dcdc61-9972-4260-a277-0fbda69f277fWhen should a reorg be run?tfrangos2700019NFCactivefalseComment Entriesapplication/atom+xml;type=entryLikestrue2008-06-24T09:50:43-04:002008-06-25T00:17:44-04:00Today's post comes from Harjit Thind. <br>Harjit is a DB2 LUW support analyst that has been with the DB2 support team since 2000. As well as his DB2 LUW skills Harjit is also knowlegeable on Datalinks and BCU.<br/><br/><p><br/><br/>Over the years we have had many questions about when or how often should a reorg be run on tables in a database.<br/><br/></p><br/><br/><p>Runstat and reorgchk should be run on a regular basis.. whereas reorg on tables should be run on an as needed basis depending on the output from reorgchk.<br>Rerogchk can be run with option <current statistics> or <update statistics> on table <tablename><br>For more command options check the <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.admin.doc/doc/r0001971.htm"> reorgchk command </a>options.<br></p><br/><br/><p>Now, how to make a descision if a reorgchk needs to be run or not.<br>In the output depending on the table statistics and index statistics output<br></p><p><br><img src="https://ltsgwascl006.sby.ibm.com/developerworks/blogs/resources/db2luwtechsupport/tablestats1.gif"><br/><br/></p><p>REORG <br>    Each hyphen (-) displayed in this column indicates that the calculated results were within the set bounds of the corresponding formula, and each asterisk (*) indicates that the calculated results exceeded the set bounds of its corresponding formula. <br><ol><li> - or * on the left side of the column corresponds to F1 (Formula 1) </li><li> - or * in the middle of the column corresponds to F2 (Formula 2) </li><li> - or * on the right side of the column corresponds to F3 (Formula 3)</li> </ol><br><br/><br/>    Table reorganization is suggested when the results of the calculations exceed the bounds set by the formula.<br></p><br/><br/><p>  For example, --- indicates that, since the formula results of F1, F2, and F3 are within the set bounds of the formula, no table reorganization is suggested. The notation *-* indicates that the results of F1 and F3 suggest table reorganization, even though F2 is still within its set bounds. The notation *-- indicates that F1 is the only formula exceeding its bounds.</p><br><br/><br/><p><img src="https://ltsgwascl006.sby.ibm.com/developerworks/blogs/resources/db2luwtechsupport/Indexstats1.gif"></p><br/><br/><br><p>REORG<br>  Each hyphen (-) displayed in this column indicates that the calculated results were within the set bounds of the corresponding formula, and each asterisk (*) indicates that the calculated result exceeded the set bounds of its corresponding formula.<br><ol><li> - or * on the left column corresponds to F4 (Formula 4) </li><li> - or * in the second from left column corresponds to F5 (Formula 5)</li><li> - or * in the middle column corresponds to F6 (Formula 6)</li><li> - or * in the second column from the right corresponds to F7 (Formula 7)</li><li> - or * on the right column corresponds to F8 (Formula 8)</li></ol><br>  Index reorganization advice is as follows:<br><p><br/><br/><br>  * If the results of the calculations for Formula 1,2 and 3 do not exceed the bounds set by the formula and the results of the calculations for Formula 4,5 or 6 do exceed the bounds set, then index reorganization is recommended.<br><br>  * If only the results of the calculations Formula 7 exceed the bounds set, but the results of Formula 1,2,3,4,5 and 6 are within the set bounds, then cleanup of the indexes using the CLEANUP ONLY option of REORG INDEXES is recommended.<br><br>  * If the only calculation result to exceed the set bounds is the that of Formula 8, then a cleanup of the pseudo empty pages of the indexes using the CLEANUP ONLY PAGES option of REORG INDEXES is recommended. <br><br/><br/>Today's post comes from Harjit Thind. <br>Harjit is a DB2 LUW support analyst that has been with the DB2 support team since 2000. As well as his DB2 LUW skills Harjit is also knowlegeable on Datalinks and BCU.<br/><br/><p><br/><br/>Over the years we have had many questions about when or how often should a reorg be run on tables in a database.<br/><br/></p><br/><br/><p>Runstat and reorgchk should be run on a regular basis.. whereas reorg on tables should be run on an as needed basis depending on the output from reorgchk.<br>Rerogchk can be run with option <current statistics> or <update statistics> on table <tablename><br>For more command options check the <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.admin.doc/doc/r0001971.htm"> reorgchk command </a>options.<br></p><br/><br/><p>Now, how to make a descision if a reorgchk needs to be run or not.<br>In the output depending on the table statistics and index statistics output<br></p><p><br><img src="https://ltsgwascl006.sby.ibm.com/developerworks/blogs/resources/db2luwtechsupport/tablestats1.gif"><br/><br/></p><p>REORG <br>    Each hyphen (-) displayed in this column indicates that the calculated results were within the set bounds of the corresponding formula, and each asterisk (*) indicates that the calculated results exceeded the set bounds of its corresponding formula. <br><ol><li> - or * on the left side of the column corresponds to F1 (Formula 1) </li><li> - or * in the middle of the column corresponds to F2 (Formula 2) </li><li> - or * on the right side of the column corresponds to F3 (Formula 3)</li> </ol><br><br/><br/>    Table reorganization is suggested when the results of the calculations exceed the bounds set by the formula.<br></p><br/><br/><p>  For example, --- indicates that, since the formula results of F1, F2, and F3 are within the set bounds of the formula, no table reorganization is suggested. The notation *-* indicates that the results of F1 and F3 suggest table reorganization, even though F2 is still within its set bounds. The notation *-- indicates that F1 is the only formula exceeding its bounds.</p><br><br/><br/><p><img src="https://ltsgwascl006.sby.ibm.com/developerworks/blogs/resources/db2luwtechsupport/Indexstats1.gif"></p><br/><br/><br><p>REORG<br>  Each hyphen (-) displayed in this column indicates that the calculated results were within the set bounds of the corresponding formula, and each asterisk (*) indicates that the calculated result exceeded the set bounds of its corresponding formula.<br><ol><li> - or * on the left column corresponds to F4 (Formula 4) </li><li> - or * in the second from left column corresponds to F5 (Formula 5)</li><li> - or * in the middle column corresponds to F6 (Formula 6)</li><li> - or * in the second column from the right corresponds to F7 (Formula 7)</li><li> - or * on the right column corresponds to F8 (Formula 8)</li></ol><br>  Index reorganization advice is as follows:<br><p><br/><br/><br>  * If the results of the calculations for Formula 1,2 and 3 do not exceed the bounds set by the formula and the results of the calculations for Formula 4,5 or 6 do exceed the bounds set, then index reorganization is recommended.<br><br>  * If only the results of the calculations Formula 7 exceed the bounds set, but the results of Formula 1,2,3,4,5 and 6 are within the set bounds, then cleanup of the indexes using the CLEANUP ONLY option of REORG INDEXES is recommended.<br><br>  * If the only calculation result to exceed the set bounds is the that of Formula 8, then a cleanup of the pseudo empty pages of the indexes using the CLEANUP ONLY PAGES option of REORG INDEXES is recommended. <br><br/><br/>Today's post comes from Harjit Thind. Harjit is a DB2 LUW support analyst that has been with the DB2 support team since 2000. As well as his DB2 LUW skills Harjit is also knowlegeable on Datalinks and BCU. Over the years we have had many questions about when...015479