👁 0
Q: What is RUNSTATS and when to use it?
Answer:
RUNSTATS collects table/index statistics for optimizer. Run after significant data changes (loads, deletes). Updates catalog tables (SYSTABLES, SYSINDEXES). Optimizer uses for access path selection. RUNSTATS TABLESPACE db.ts INDEX(ALL).
👁 0
Q: What is VOLATILE table?
Answer:
VOLATILE TABLE hints optimizer to expect different row counts. Useful for varying cardinality. CREATE TABLE ... VOLATILE CARDINALITY. Or ALTER TABLE ... VOLATILE. Helps when statistics mislead optimizer.
👁 0
Q: Explain access path selection
Answer:
Optimizer chooses access path based on statistics, predicates, indexes. Index scan vs tablespace scan. Join methods: nested loop, merge scan, hybrid. Sort operations. EXPLAIN reveals choice. Tuning influences path.
👁 0
Q: What is profile table?
Answer:
Profile tables store user-specific optimizer settings. DSN_PROFILE_TABLE, DSN_PROFILE_ATTRIBUTES. Override defaults for specific statements. Use QUERYNO correlation. Advanced tuning technique.