👁 0
Q: How to tune DB2 queries?
Answer:
Check EXPLAIN output. Look at: access type (index vs scan), join method, sort operations. Add indexes for predicates. Rewrite with hints. Update statistics. Check for full tablespace scans. Monitor actual execution.
👁 0
Q: Explain FREESPACE parameter
Answer:
FREESPACE(cipct capct). CI percent free for inserts. CA percent free for splits. FREESPACE(20 10) leaves 20% CI, 10% CA free. More freespace reduces splits but uses more space. Tune based on activity.
👁 0
Q: How to improve KSDS performance?
Answer:
Appropriate CISIZE, FREESPACE. Adequate buffers (BUFND/BUFNI). Index in cache if possible. IMBED obsolete. Keep file organized (REORG). Monitor CA/CI splits. Sequential access for bulk.
👁 0
Q: What is FREESPACE distribution?
Answer:
FREESPACE spread across CIs and CAs. Initial load distributes evenly. After activity, distribution varies. REORG restores even distribution. Monitor CI/CA splits for tuning.
👁 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.
👁 0
Q: What is zparm?
Answer:
ZPARM (DSNZPARMs) are DB2 installation parameters. Control system behavior, limits, defaults. DSNZPARM module loaded at startup. Changes need restart usually. Critical for performance and security tuning.
👁 0
Q: What is ORDERED attribute?
Answer:
ORDERED on DEFINE allocates volumes in specified order. Without ORDERED, system chooses. ORDERED ensures predictable allocation. May be important for performance tuning.
👁 0
Q: What is EXPLAIN and how to use it?
Answer:
EXPLAIN analyzes query access path. EXPLAIN PLAN SET QUERYNO=1 FOR SELECT... Results in PLAN_TABLE. Shows index usage, join method, sort operations. Use for performance tuning. Review ACCESSTYPE, MATCHCOLS, PREFETCH columns.