👁 0
Q: What is SPANNED record?
Answer:
Spanned records exceed CI size, span multiple CIs. DEFINE CLUSTER ... RECORDSIZE(avg max) SPANNED. CI too small for max record. Performance impact. Use appropriately sized CI when possible.
👁 0
Q: What is SPANNED records impact?
Answer:
Spanned records span CIs. More I/O for spanned record access. CI header overhead per CI. Avoid if possible by larger CI. Performance degradation for random access.
👁 0
Q: What is DISTINCT keyword?
Answer:
DISTINCT eliminates duplicate rows. SELECT DISTINCT col FROM table. Applies to entire row, not single column. Causes sort for duplicate elimination. Performance impact. Avoid if possible. Sometimes indicates bad design.
👁 0
Q: Explain DB2 triggers
Answer:
Trigger fires automatically on INSERT/UPDATE/DELETE. CREATE TRIGGER name AFTER/BEFORE/INSTEAD OF event ON table FOR EACH ROW/STATEMENT. Use for audit, validation, derived columns. Can impact performance.
👁 0
Q: What is FETCH SENSITIVE cursor?
Answer:
SENSITIVE cursor reflects concurrent changes by other processes. EXEC SQL DECLARE cursor SENSITIVE STATIC/DYNAMIC SCROLL CURSOR. INSENSITIVE does not see changes. Affects isolation behavior. Consider performance impact.