Related Documentation Download this Manual
PDF (US Ltr) - 40.3Mb
PDF (A4) - 40.4Mb
Man Pages (TGZ) - 259.3Kb
Man Pages (Zip) - 366.3Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 9.1 Reference Manual  /  General Information  /  What Is New in MySQL 9.1

1.4 What Is New in MySQL 9.1

This section summarizes what has been added to, deprecated in, changed, and removed from MySQL 9.1 since MySQL 9.0. A companion section lists MySQL server options and variables that have been added, deprecated, or removed in MySQL 9.1; see Section 1.5, “Server and Status Variables and Options Added, Deprecated, or Removed in MySQL 9.1”.

Features Added or Changed in MySQL 9.1

The following features have been added to MySQL 9.1:

  • Triggers no longer loaded by read-only operations.  Previously, for a table having one or more triggers, the triggers were fully parsed and loaded into memory every time the table was accessed. This was problematic for two reasons:

    1. Cached trigger objects consumed space in the table cache, even when they were not actually used because the statement accessing the table did not change any data. For example, this occurred when the table was accessed by a SELECT statement.

    2. Parsing and caching of triggers which were not used added unnecessary processing time to read-only operations such as SELECT or TABLE statements.

    These issues often resulted in unexpectedly high resource usage and unreasonably long execution times in scenarios involving many tables, complex triggers, or both, in which no data was changed. They also led to unnecessary resource usage on read-only replicas.

    The problems just described have been solved in MySQL 9.1 as follows:

    • The process of parsing and loading triggers has been divided into two phases: In the first phase, only the trigger metadata is read from the data dictionary, since this can be stored once and shared between different instances of the same trigger. Parsing and execution of the trigger is done in the second phase.

    • The second phase described in the previous item is performed only for statements that modify table data. This eliminates consumption of resources by parsing and caching triggers which are not actually used.

    • Memory usage is further improved by replacing static allocation of buffers for trigger errors with the use of variably sized buffers which are allocated on demand, instead.

    This feature is implemented by tracking tables having triggers in the table cache separately from tables which do not. The maximum number of open tables which have triggers and which are held in the table cache at any given time is determined by the value of the server system variable table_open_cache_triggers, which is added in MySQL 9.1.0. Leaving this variable at its default value means that no tables are evicted from the cache based on whether they have fully loaded trigger, which is the same as in previous versions of MySQL. The following server status variables which track cache usage for tables having triggers are also added in this release:

    In addition, as part of this work, SHOW CREATE TRIGGER, which reads but does not modify data, now displays the complete definition of all triggers, even in cases where trigger bodies cannot be parsed. Such triggers might be present in the data dictionary after upgrading the MySQL server to a version that no longer supports the syntax used in those triggers.

    For more information, see the descriptions of the server variables mentioned previously. For general information about the table cache, see Section 10.4.3.1, “How MySQL Opens and Closes Tables”.

  • EXPLAIN output enhancements.  A number of improvements have been made in the output of EXPLAIN. Information about these changes follows in the next few paragraphs.

    EXPLAIN output now includes information about multi-range reads in the following two cases:

    • When explain_json_format_version=2, the output from EXPLAIN FORMAT=JSON now includes "multi_range_read": true whenever multi-range read and index range scan access paths are used.

    • (Multi-Range Read) now appears in the operation field in EXPLAIN FORMAT=TREE output for index range scans using multi-range reads.

    EXPLAIN FORMAT=TREE also now includes information about the semijoin strategy employed, if any.

    In addition, for consistency of output, spaces have been added before and after the = sign in the condition shown for lookup_condition by EXPLAIN FORMAT=JSON when explain_json_format_version=2, as well as those shown for operation when using EXPLAIN FORMAT=TREE.

    For more information about these optimizations, see Section 10.2.1.11, “Multi-Range Read Optimization”, and Section 10.2.2.1, “Optimizing IN and EXISTS Subquery Predicates with Semijoin and Antijoin Transformations”.

  • CREATE VIEW IF NOT EXISTS.  MySQL 9.1 adds support for an IF NOT EXISTS clause for the CREATE VIEW statement. If the view named in the statement does not exist, it is created as though the clause were not used. If the view already exists, the statement appears to succeed but does not change the view definition, and yields a warning, as shown here:

    mysql> CREATE VIEW IF NOT EXISTS v1 AS SELECT c1, c3 FROM t1;
    Query OK, 0 rows affected, 1 warning (0.01 sec)
    
    mysql> SHOW WARNINGS;
    +-------+------+---------------------------+
    | Level | Code | Message                   |
    +-------+------+---------------------------+
    | Note  | 1050 | Table 'v1' already exists |
    +-------+------+---------------------------+
    1 row in set (0.00 sec)

    IF NOT EXISTS cannot be used together with OR REPLACE; attempting to do so causes the CREATE VIEW statement to be rejected with a syntax error.

    See Section 15.1.23, “CREATE VIEW Statement”, for more information.

  • Crash-safe database DDL statements.  CREATE DATABASE and DROP DATABASE are now fully atomic and crash-safe, as long as all tables in the named database employ a storage engine supporting atomic DDL such as InnoDB. This resolves the following issues:

    • When CREATE DATABASE failed after the database directory was created but before the operation was actually committed, the data dictionary had no record of the database's existence, but the database directory itself was still present in the file system, requiring manual cleanup.

    • When removal of the database directory as part of DROP DATABASE was unsuccessful due to a file system error or an unexpected shutdown, the transaction containing DROP DATABASE was not always rolled back; manual intervention was necessary in such cases to rectify the problem.

    See Section 15.1.1, “Atomic Data Definition Statement Support”, for more information.

  • VECTOR support in JavaScript programs.  The VECTOR type is fully supported by JavaScript stored programs in MySQL 9.1 and later. VECTOR values can now be used with JavaScript programs as input arguments, output arguments, prepared statement bind() parameters, and return values.

    See Section 27.3.4, “JavaScript Stored Program Data Types and Argument Handling”, for more information and examples.

  • Replication applier statistics tables.  MySQL Enterprise: The Replication Applier Metrics component (component_replication_applier_metrics), added in MySQL 9.1.0, provides users with statistical information about the replication applier in the form of the two Performance Schema tables listed here:

    This component and the Performance Schema tables it implements enhance observability of replication by gathering statistics from the entire replication pipeline. For MySQL Enterprise users, this unifies the collection and presentation of statistics by replacing the subtoptimal logging of applier metrics into the error log as done in previous versions of MySQL. This facilitates observability, troubleshooting and forensics when operating a MySQL service. In addition, some metrics which were not helpful have been replaced with more useful ones.

    See Section 7.5.6, “Replication Applier Metrics Component”, for more information.

  • OpenID Connect Support.  MySQL 9.1 adds support for OpenID Connect authentication with MySQL Enterprise Edition using the authentication_openid_connect server-side authentication plugin.

    See Section 8.4.1.9, “OpenID Connect Pluggable Authentication”, for more information.

  • Option Tracker component.  The Option Tracker component (component_option_tracker) added in MySQL 9.1.0 provides information about options (features) present in the MySQL server as well as those in components and plugins. This component is available as part of MySQL Enterprise Edition.

    Option information is available from two tables installed by installing the Option Tracker component, listed here:

    • The Performance Schema mysql_option table contains information about all options installed on the server, including name, component name (or MySQL Server), and whether the option is currently enabled. This table is read-only.

    • The option_usage table, in the mysql_option database installed by the Option Tracker component, shows usage information for each option on the system; this information is presented in JSON format. If the server acts as a node in a Group Replication cluster, its server ID and cluster ID are also shown in this table. This table can be updated.

    The Option Tracker component supplies the Group replication status variables listed here:

    See Section 7.5.9.3, “Option Tracker Status Variables”, for more information.

    The component also supplies the following functions for working with Option Tracker usage data and tables:

    See Section 7.5.9.4, “Option Tracker Functions”, for information about using these functions.

    Use of the Option Tracker functions requires the OPTION_TRACKER_UPDATER privilege, which is also implemented by the component.

    For a given option, the values of the OPTION_NAME column of the mysql_option table and the column having the same name in the option_usage table are the same. You can use these as join columns to obtain consildated output; see Section 7.5.9.1, “Option Tracker Tables”, for an example.

    See Section 7.5.9, “Option Tracker Component”, for more information as well as Section 29.12.22.6, “The mysql_option Table”.

  • AWS keyring component.  MySQL 9.1 introduces the component_keyring_aws keyring component, which uses the Amazon Web Services Key Management Service (AWS KMS) as a back end for key generation and a local file for key storage. It is intended to replace the AWS keyring plugin, which is now deprecated. For more information, see Section 8.4.4.8, “Using the component_keyring_aws AWS Keyring Component”.

    For a general comparison of MySQL keyring components with keyring plugins, see Section 8.4.4.1, “Keyring Components Versus Keyring Plugins”.

    For help with migration, see Migration from AWS keyring plugin.

  • Group Replication flow control statistics component.  MySQL 9.1.0 introduces a component (component_group_replication_flow_control_stats) which provides statistics about transactions throttled by Group Replication flow control. This component is available as part of MySQL Enterprise Edition.

    Note

    Installation of this component requires that the Group Replication plugin already be installed (see Section 20.2.1.2, “Configuring an Instance for Group Replication”). Once installed, it must be uninstalled before you can uninstall the Group Replication plugin.

    Flow control throttling statistics are made available as the global status variables listed here:

    These variables are visible in the Performance Schema global_status table as well as the output of SHOW GLOBAL STATUS; their values are specific to each group member.

    For more information, see Section 7.5.7, “Group Replication Flow Control Statistics Component”, as well as the descriptions of the status variables listed.

  • Windows Hello support.  MySQL webauthn plugins now support the Windows Hello passkey store as a software device in addition to the hardware devices (such as USB keys) already supported. The plugin also adds the mysql client option --plugin-authentication-webauthn-device=#; when multiple devices are available, this option sets the device number. If no device is specified, the first one (0) is used by default; this also provides backwards compatibility.

    The libfido2 library used with MySQL with is now compiled with support for generating passkeys stored in the Windows Hello passkey store, and authenticating against such passkeys. Windows 11 and later is supported using the MySQL authentication_webauthn plugin.

    Only passkeys stored in the Windows Hello passkey store are currently supported by the Windows Hello device

    Stored passkey deletion from the Windows passkey store must peformed using system tools; the mysql client does not provide a way to delete a passkey.

    See Section 8.4.1.11, “WebAuthn Pluggable Authentication”, for more information.

Features Deprecated in MySQL 9.1

The following features are deprecated in MySQL 9.1 and may be removed in a future series. Where alternatives are shown, applications should be updated to use them.

For applications that use features deprecated in MySQL 9.1 that have been removed in a later MySQL version, statements may fail when replicated from a MySQL 9.1 source to a replica running a later version, or may have different effects on source and replica. To avoid such problems, applications that use features deprecated in 9.1 should be revised to avoid them and use alternatives when possible.

Features Removed in MySQL 9.1

The following items are obsolete and have been removed in MySQL 9.1. Where alternatives are shown, applications should be updated to use them.

For MySQL 9.0 applications that use features removed in MySQL 9.1, statements may fail when replicated from a MySQL 9.0 source to a MySQL 9.1 replica, or may have different effects on source and replica. To avoid such problems, applications that use features removed in MySQL 9.1 should be revised to avoid them and use alternatives when possible.