Thread: DB2

RUNSTATS frequency for high-insert tables - metric guidance

Started by Elena • user4 replies278 viewsLast activity 1 month ago
Post #1
0 votes
Elena
Reputation
391
Posts: 6
Joined: Apr 18, 2024, 9:30 AM
Posted: Jun 9, 2026, 10:43 AM

Dear colleagues,

Our warehouse fact table receives approximately four million inserts per day. Current RUNSTATS executes weekly via a scheduled utility job. We are observing suboptimal access paths on queries filtering by BUSINESS_DATE after the third day post-RUNSTATS.

Sample utility control card:

jcl
//STEP1 EXEC PGM=DSNUTILB,REGION=0M
//STEPLIB DD DSN=DB2.RUNLIB.LOAD,DISP=SHR
//SYSIN DD *
  RUNSTATS TABLESPACE DSNDB04.FACTTS
            TABLE(WAREHOUSE.SALES_FACT)
            SHRLEVEL CHANGE
            UPDATE ALL
/*

IBM documentation notes:

SHRLEVEL CHANGE allows concurrent DML during RUNSTATS but may produce statistics that reflect an intermediate state.

Would you increase RUNSTATS frequency, move to STOSPACE-based triggers, or adopt real-time statistics if licensed? I am particularly interested in how you quantify "stale enough to matter."

Regards,
Elena

Post #2
0 votes
Sandra
Reputation
198
Posts: 9
Joined: Oct 15, 2024, 8:30 AM
Posted: Jun 9, 2026, 2:43 PM

We monitor NPAGESF drift and insert volume since last RUNSTATS. When inserts exceed twenty percent of table cardinality, a trigger job queues RUNSTATS for that tablespace overnight.

Real-time statistics helped on two pilot tables but licensing and overhead must be justified per object.

Post #3
0 votes
Elena
Reputation
391
Posts: 6
Joined: Apr 18, 2024, 9:30 AM
Posted: Jun 10, 2026, 11:43 AM

Thank you. Would you share whether you use RTS on the insert-heavy tables only, or broadly across the subsystem?

Post #4
0 votes
Sandra
Reputation
198
Posts: 9
Joined: Oct 15, 2024, 8:30 AM
Posted: Jun 10, 2026, 5:43 PM

Insert-heavy and tables with volatile distribution on leading index columns only. Static reference tables remain on weekly batch RUNSTATS.

You must be signed in to reply to this thread