So, a good news for all MySQL fans that the world’s most famous RDBMS is releasing it’s new version MySQL 8.0. The official release date is not declared yet but this is going to be exciting as they have added some really useful new features.
So, why waste any time let’s see what’s new in MySQL 8.0:
- Roles – Very exciting feature that allows to create roles in MySQL server and assign specific privileges to them. These roles can be assigned to users. So from now you don’t have to remember which permissions a programmer from team X needs, and should a QA from team Y needs privilege Z. Also, it’s very easy to set up:
- Creating a new role:
- Assigning privileges to roles:
- Assigning the role to a user:
- Creating a new role:
- Invisible index – ever wanted to just hide an index you currently don’t need, without actually dropping it? Now you can. If you’re not sure if you need an index, you can mark it as invisible and MySQL optimizer won’t use it. After monitoring for your server and queries performance, you can decide to re-activate it in case you believe it will result in a performance boost.
- Configuration Persistence – Changing configuration during MySQL runtime is commonly done using SET GLOBAL. This disadvantage in this technique is that the changes will not survive a server restart. here comes SET PERSIST to the rescue, which does exactly that, apply configuration changes which survive a MySQL server restart.
- Default character set and collation – Starting MySQL 8.0, the default character set will be utf8mb4 and the collation will be utf8mb4_800_ci_ai. These are great news and one step ahead towards standardized multilingual support in data driven applications.
- UUID Enhancements – UUIDs are usually used to generate unique ids in tables. Starting this new version, MySQL can hold these values in a VARBINARY(16) column instead of CHAR(36). The impact of this change is better storage usage and performance improvement. Also, three new functions were introduced to handle these UUID values: BIN_TO_UUID(), UUID_TO_BIN(), IS_UUID().
- Cost Model Improvements – for the first time, MySQL’s cost model will look into the memory and check if the relevant data for the query already resides in memory. As a result of this change, different query plans can be chosen. this will happen automatically without need for extra configuration.
- Descending Indexes – MySQL now allows to create descending indexes and scan them in a reverse order, without performance penalty. This was possible in the past, but you would have to take the performance hit on that.
- Common Table Expressions – CTE is a new feature (which is already available in other databases) that will simplify the way you write complex queries. To put it in simple words, using this feature (the WITH select) will automatically create a temporary table behind the scenes, which you can use in the same query and refer to it. This temporary table / view can only be used in that single query. This feature introduces both readability and performance improvements.