👁 0
Q: Explain predicate types
Answer:
Stage 1 predicates evaluated by storage engine. Stage 2 evaluated by DB2 (more expensive). Indexable predicates can use index. Non-indexable force scan. Design for stage 1/indexable predicates. EXPLAIN shows predicate staging.
👁 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: What is OPTIMIZE FOR n ROWS?
Answer:
OPTIMIZE FOR n ROWS hints expected rows. SELECT * FROM t ORDER BY c OPTIMIZE FOR 1 ROW. Influences access path. Low n favors index. High n may favor scan. Use when you know actual row count.
👁 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 TYPRUN parameter?
Answer:
TYPRUN options: SCAN (syntax check, no execution), HOLD (submit but hold), COPY (copy JCL to SYSOUT), JCLHOLD (hold with JCL). TYPRUN=SCAN validates JCL without running. Useful for testing complex JCL before production.
👁 0
Q: How to use JCLTEST?
Answer:
TYPRUN=JCLTEST validates JCL without execution. Checks syntax, dataset names, authorization. Some systems support TYPRUN=SCAN which is similar. Submit job and check messages. No resources actually allocated.