MySQL 8 Features: New features of MySQL 8.0
The following features of MySQL have been added to MySQL 8.0
- Character set support
- Window Functions
- Roles in MySQL 8.0
- Invisible indexes support
- MySQL Data Dictionary
- JSON Enhancements
The default character set has changed from latin1 to utf8mb4.
MySQL now supports window functions. Window functions perform some calculation on a set of rows. It’s like a GROUP BY but preserving rows rather than collapsing them.
|CUME_DIST()||Cumulative distribution value|
|ROW_NUMBER()||Number of current row within its partition|
|RANK()||Rank of current row within its partition, with gaps|
|DENSE_RANK()||Rank of current row within its partition, without gaps|
|PERCENT_RANK()||Percentage rank value|
|FIRST_VALUE()||Value of argument from first row of window frame|
|LAST_VALUE()||Value of argument from first row of window frame|
- MySQL 8.0 supports Roles, the ability of defining a set of privileges as a named role and then granting that set to one or more users
- The main benefits are more clarity of privileges and ease of administration.
- Using roles we can assign the same set of privileges to several users, and eventually modify or revoke all privileges at once.
MySQL 8.0 support Descending Indexes - DESC. Now the key values are stored in descending order. A descending index can be scanned in forward order, which is more efficient.
MySQL now incorporates a transactional data dictionary that stores information about database objects. In previous MySQL releases, dictionary data was stored in metadata files and nontransactional tables
MySQL 8.0 added some new JSON functions and improves performance for sorting and grouping JSON values.
- ->> has been added, this is the equivalent of JSON_UNQUOTE(JSON_EXTRACT())
- New aggregation functions JSON_ARRAYAGG() and JSON_OBJECTAGG()
- Added some more function like - JSON_TABLE() and JSON_PRETTY()
- JSON utility function like JSON_STORAGE_SIZE() and JSON_STORAGE_FREE()
You may also like - React Js Interview Questions
- The utf8mb3 character set is deprecated in MySQL 8.0. Please use utf8mb4 instead.
- The PAD_CHAR_TO_FULL_LENGTH SQL mode is deprecated.
- The JSON_MERGE() function is deprecated. Use JSON_MERGE_PRESERVE() instead.