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.
On top of that, new server status variables like Table_open_cache_triggers_hits
and Table_open_cache_triggers_misses
have been introduced to track cache usage, further enhancing monitoring capabilities.
The EXPLAIN
command, used for understanding query execution plans, has also received several updates. The output now includes more detailed information regarding multi-range reads, semijoin strategies, and consistent formatting of condition strings. This helps developers gain more insights into query performance and optimize their databases effectively.
Another noteworthy addition is support for the IF NOT EXISTS
clause in the CREATE VIEW
statement. This allows users to attempt creating a view without worrying if it already existsโif it does, no changes are made, and a warning is issued instead of an error.
MySQL 9.1 also introduces crash-safe CREATE DATABASE
and DROP DATABASE
statements. This means that as long as tables use a storage engine supporting atomic DDL operations, like InnoDB, database creation and deletion are now fully transactional.
What is the benefit of this? In short, it helps avoid inconsistencies in case of unexpected server shutdowns or errors during database creation or deletion.
Regarding flexibility, MySQL 9.1 now supports VECTOR data types in JavaScript-stored programs. This means that VECTOR
values can be used as input and output arguments in stored procedures, which is particularly beneficial for applications utilizing advanced vector operations.
For MySQL Enterprise users, introducing new replication applier metrics greatly improves the observability of replication processes. Administrators can now monitor replication progress more effectively and gather useful statistics, making it easier to troubleshoot and maintain a stable replication environment.
Moreover, MySQL 9.1 now supports OpenID Connect to enhance authentication flexibility and enable integration with modern single sign-on systems. This feature is available in MySQL Enterprise Edition, making user management more seamless, particularly in large-scale environments.
Additionally, the new Option Tracker component helps monitor MySQL server options, including those related to installed plugins and components. This component is also available as part of MySQL Enterprise Edition and provides a clear view of all options enabled on the server.
Lastly, while MySQL 9.1 has introduced many useful features, it also marks the deprecation of certain elements. Some features are deprecated, which means they will be removed in future releases. Developers should start updating their applications to avoid relying on these deprecated features.
In addition, some features have already been removed in MySQL 9.1, which might affect older applications. So, the database administrators should review their usage of MySQL 9.0 features and adjust accordingly to ensure compatibility before moving to 9.1.
For more in-depth details, check out theย release notesย or look here to review all the novelties this release brings.