SyntaxStudy
Sign Up
MySQL Trigger Limitations and Gotchas
MySQL Advanced 7 min read

Trigger Limitations and Gotchas

While triggers are powerful, they come with limitations and potential pitfalls that you must understand to use them safely and effectively.

Key Limitations

  • Triggers cannot call stored procedures that use transactions (COMMIT/ROLLBACK)
  • A trigger cannot directly call another trigger on the same table (no recursive triggers by default)
  • TRUNCATE TABLE does not fire DELETE triggers
  • MySQL allows only one trigger per event/timing combination per table (before MySQL 5.7.2; after that, multiple triggers per event are allowed)
  • Triggers make debugging harder because they run invisibly alongside DML statements

Performance Considerations

Triggers add overhead to every qualifying DML operation. Heavy trigger logic on high-traffic tables can significantly impact performance. Keep trigger bodies minimal and avoid complex queries inside triggers on hot tables.

Viewing and Dropping Triggers

Use SHOW TRIGGERS to list triggers and DROP TRIGGER to remove them.

Example
-- List all triggers in the current database
SHOW TRIGGERS;

-- List triggers for a specific table
SHOW TRIGGERS LIKE 'orders';

-- Drop a trigger
DROP TRIGGER IF EXISTS after_order_delete;

-- View trigger definition
SELECT TRIGGER_NAME, EVENT_MANIPULATION, ACTION_TIMING, ACTION_STATEMENT
FROM information_schema.TRIGGERS
WHERE TRIGGER_SCHEMA = DATABASE();
Pro Tip

Document all triggers in your project README — they are invisible side effects that surprise developers who are not aware of them.