0

What is the major differences between:

  1. RUNSTATS ON TABLE 'mytable' WITH DISTRIBUTION AND DETAILED INDEXES ALL
  2. REORG INDEXES FOR 'MYTABLE'
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.