MySQL 9.1: New Features, Deprecations, and Important Updates
Quoting: MySQL 9.1: New Features, Deprecations, and Important Updates —
MySQL 9.1, a widely adopted open-source RDBMS, is here, bringing improvements, new features, and a few deprecations. Among the most striking novelties is how triggers are handled, particularly during read-only operations.
In earlier versions, triggers associated with a table were fully loaded and parsed each time the table was accessed, even for read-only statements like SELECT. This not only wasted memory but also increased execution time unnecessarily.
Now, in MySQL 9.1, triggers are handled in two distinct phases. Initially, only the trigger metadata is read, and parsing is deferred until it’s actually needed (i.e., when modifying data). This significantly reduces the resource consumption for read-only queries and improves overall performance.