Bird
0
0

Consider a trigger that updates a log table after each row insert on a large table. What is the likely performance impact?

medium📝 query result Q4 of 15
SQL - Triggers
Consider a trigger that updates a log table after each row insert on a large table. What is the likely performance impact?
AThe insert operation will slow down due to extra logging
BThe insert operation will speed up because of logging
CThe trigger will run asynchronously without impact
DThe trigger will prevent inserts from happening
Step-by-Step Solution
Solution:
  1. Step 1: Understand trigger behavior on inserts

    Triggers run synchronously during insert operations.
  2. Step 2: Analyze effect of logging in trigger

    Logging each row insert adds extra work, slowing down the insert.
  3. Final Answer:

    The insert operation will slow down due to extra logging -> Option A
  4. Quick Check:

    Logging in trigger = Slower inserts [OK]
Quick Trick: Triggers run synchronously, adding to operation time [OK]
Common Mistakes:
  • Assuming triggers run asynchronously
  • Thinking triggers speed up operations
  • Believing triggers block all inserts

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes