DB2: 5 Bold Ideas When to Execute Runstats

Table performance optimality you need. A Table with properly optimized saves a lot of time and shows better performance. So for optimization, you need updated statistics, and this is possible with Rustats utility. You May Also Like Array vs List in Python Top Differences.

This is a question for developers while working on projects and when they give interviews. Runstats is a utility that collects statistics and sends these to the optimizer for the right decision.

Photo by Engin Akyurt on Pexels.com

When to Run Runstats in DB2

You need to run this utility during the below scenarios.

  1. When a table is loaded
  2. When an index is created
  3. When a tablespace is reorganized
  4. When there have been extensive updates, deletions, or insertions in a tablespace
  5. After the recovery of a tablespace to a prior point in time

How Optimizer Decision Affects When You Not Collect Statistics

  1. The optimizer may not take the right decision for multi-joint tables query
  2. The optimizer may choose the wrong choice of index, which in turn affects performance
  3. When a column designed to have default values, you need to run the RUNSTATS utility for frequency value statistics help in better decision

How to Know When to Execute Runstats

  • You need to refer to SYSIBM.SYSCOLDIST catalog table about the running of Runstats utility is needed or not. The IBM Data Studio tool will also show those statistics.

Keep Reading

Python does not support arrays. However, it supports Lists. The given examples help you know the differences between these two.

Array vs List in Python Top Differences

Python does not support arrays. However, it supports Lists. The given examples help you know the differences between these two.

DB2: Nested Labels in SQL Procedure

SQL procedure saves your time when writing it for repetitive tasks. On top of that, writing code with Labels improves readability. So that maintenance is easy.

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

Start Discussion

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.