What is the major differences between:
RUNSTATS ON TABLE 'mytable' WITH DISTRIBUTION AND DETAILED INDEXES ALL
REORG INDEXES FOR 'MYTABLE'
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
RUNSTATS collects statistics for tables and indexes. This could be done in different detail levels - the one you describe is very detailed. These stats are stored in the database and used by the optimzer for determining the most efficient access path. RUNSTATS does nothing to the data itself.
REORG on the other side moves and organizes data (table or index data). Rows marked as deleted will be deleted, data may be reorganized to a certain index to get it ordered and more efficient to fetch in certain situations.
Because REORG moves data and changes physical things that are part of the statistics it is recommended to run RUNSTATS after REORGS.