#MySQL #oow16. MySQL Server 8.0. Geir Høydalsvik

Similar documents
MySQL Server 8.0. Geir Høydalsvik. Copyright 2016, 2017, Oracle and/or its its affiliates. All All rights reserved.

MySQL Next An overview of the MySQL 8 Beta

MySQL 8.0 What s New in the Optimizer

State of the Dolphin Developing new Apps in MySQL 8

What's New in MySQL 5.7?

MySQL 8.0: Atomic DDLs Implementation and Impact

Upgrading to MySQL 8.0+: a More Automated Upgrade Experience. Dmitry Lenev, Software Developer Oracle/MySQL, November 2018

InnoDB: What s new in 8.0

MySQL Database Administrator Training NIIT, Gurgaon India 31 August-10 September 2015

InnoDB: What s new in 8.0

MySQL for Database Administrators Ed 3.1

What s New in MySQL 5.7 Geir Høydalsvik, Sr. Director, MySQL Engineering. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

MySQL Group Replication in a nutshell

Why we re excited about MySQL 8

ITS. MySQL for Database Administrators (40 Hours) (Exam code 1z0-883) (OCP My SQL DBA)

What s New in MariaDB Server Max Mether VP Server

MySQL JSON. Morgan Tocker MySQL Product Manager. Copyright 2015 Oracle and/or its affiliates. All rights reserved.

NoSQL + SQL = MySQL. Nicolas De Rico Principal Solutions Architect

MariaDB 10.3 vs MySQL 8.0. Tyler Duzan, Product Manager Percona

Everything You Need to Know About MySQL Group Replication

CO MySQL for Database Administrators

MySQL 5.7 For Operational DBAs an Introduction. Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars

3 / 120. MySQL 8.0. Frédéric Descamps - MySQL Community Manager - Oracle

InnoDB: Status, Architecture, and Latest Enhancements

Chapter 8: Working With Databases & Tables

<Insert Picture Here> Looking at Performance - What s new in MySQL Workbench 6.2

Oral Questions and Answers (DBMS LAB) Questions & Answers- DBMS

CSC Web Programming. Introduction to SQL

What's new in MySQL 5.5? Performance/Scale Unleashed

MySQL as a Document Store. Ted Wennmark

Safe Harbor Statement

<Insert Picture Here> Upcoming Changes in MySQL 5.7 Morgan Tocker, MySQL Community Manager

6232B: Implementing a Microsoft SQL Server 2008 R2 Database

Oracle Exam 1z0-883 MySQL 5.6 Database Administrator Version: 8.0 [ Total Questions: 100 ]

MySQL for Developers. Duration: 5 Days

ORACLE DATABASE 12C INTRODUCTION

<Insert Picture Here> MySQL Cluster What are we working on

AO3 - Version: 2. Oracle Database 11g SQL

Introduction to MySQL InnoDB Cluster

MySQL for Developers. Duration: 5 Days

MySQL for Database Administrators Ed 4

Oracle 11g Invisible Indexes Inderpal S. Johal. Inderpal S. Johal, Data Softech Inc.

<Insert Picture Here> New MySQL Enterprise Backup 4.1: Better Very Large Database Backup & Recovery and More!

Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12

MySQL Document Store. How to replace a NoSQL database by MySQL without effort but with a lot of gains?

1Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8

NoSQL + SQL = MySQL Get the Best of Both Worlds

Welcome to Virtual Developer Day MySQL!

UNIT 4 DATABASE SYSTEM CATALOGUE

MySQL InnoDB Cluster. MySQL HA Made Easy! Miguel Araújo Senior Software Developer MySQL Middleware and Clients. FOSDEM 18 - February 04, 2018

Lecture 19 Query Processing Part 1

Daffodil DB. Design Document (Beta) Version 4.0

Using the MySQL Document Store

DB2 SQL Class Outline

Review -Chapter 4. Review -Chapter 5

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) Sergey Koltakov Product Manager, Database Manageability

Course Outline. MySQL Database Administration & Design. Course Description: Pre-requisites: Course Content:

Meet the Sergei Golubchik MariaDB Corporation

TINYINT[(M)] [UNSIGNED] [ZEROFILL] A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255.

MySQL & NoSQL: The Best of Both Worlds

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

State of MySQL Group Replication

NoSQL and SQL: The Best of Both Worlds

SQL Interview Questions

Building Highly Available and Scalable Real- Time Services with MySQL Cluster

ALTER TABLE Improvements in MARIADB Server. Marko Mäkelä Lead Developer InnoDB MariaDB Corporation

MySQL 5.6: Advantages in a Nutshell. Peter Zaitsev, CEO, Percona Percona Technical Webinars March 6, 2013

GridDB Advanced Edition SQL reference

Chapter 11 How to create databases, tables, and indexes

Oracle Database 18c and Autonomous Database

MySQL Replication Update

Modern Development With MySQL

Oracle APEX 18.1 New Features

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL

High Availability Using MySQL Group Replication

IT Certification Exams Provider! Weofferfreeupdateserviceforoneyear! h ps://

Lecture 5. Monday, September 15, 2014

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

SQL Commands & Mongo DB New Syllabus

Safe Harbor Statement

MySQL Replication: What's New In MySQL 5.7 and MySQL 8. Luís Soares Software Development Director MySQL Replication

Oracle 1Z0-882 Exam. Volume: 100 Questions. Question No: 1 Consider the table structure shown by this output: Mysql> desc city:

MySQL 5.0 Certification Study Guide

Sql Server Check If Global Temporary Table Exists

Index. Bitmap Heap Scan, 156 Bitmap Index Scan, 156. Rahul Batra 2018 R. Batra, SQL Primer,

CS6312 DATABASE MANAGEMENT SYSTEMS LABORATORY L T P C

MySQL Cluster An Introduction

A Unit of SequelGate Innovative Technologies Pvt. Ltd. All Training Sessions are Completely Practical & Real-time

MySQL Architecture and Components Guide

Chapter 7. Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel

UNIT-IV (Relational Database Language, PL/SQL)

Oracle Database: Introduction to SQL

ORACLE 12C NEW FEATURE. A Resource Guide NOV 1, 2016 TECHGOEASY.COM

II B.Sc(IT) [ BATCH] IV SEMESTER CORE: RELATIONAL DATABASE MANAGEMENT SYSTEM - 412A Multiple Choice Questions.

Oracle 1Z0-071 Exam Questions and Answers (PDF) Oracle 1Z0-071 Exam Questions 1Z0-071 BrainDumps

MySQL Command Syntax

Oracle Database 11g: Introduction to SQLRelease 2

Transcription:

#MySQL #oow16 MySQL Server 8.0 Geir Høydalsvik Copyright Copyright 2 2016, 016,Oracle Oracle aand/or nd/or its its aaffiliates. ffiliates. AAll ll rights rights reserved. reserved.

Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. Copyright 2016, Oracle and/or its affiliates. All rights reserved. 3

MySQL 5.7 Improvements across the board Replication InnoDB Optimizer Security Performance Schema GIS Triggers Partitioning New! SYS Schema New! JSON Performance Copyright 2016, Oracle and/or its affiliates. All rights reserved. 4

The MySQL 5.7 Story (cont.) Copyright 2016, Oracle and/or its affiliates. All rights reserved. 5

GIS Geography support Projection Performance optimizations Copyright 2016, Oracle and/or its affiliates. All rights reserved. 6

UTF- 8 The character set for the Web UTF- 8 is the dominating character set in today s applications CJK users are adopting UTF- 8 Driven by adopted words from foreign languages EN users are adopting UTF- 8 Driven by support for emojis https://en.wikipedia.org/wiki/utf- 8 Copyright 2016, Oracle and/or its affiliates. All rights reserved. 7

UTF- 8 (cont.) MySQL 8.0 New! Support for the latest Unicode 9.0 We are working on per- country collation rules Accent Sensitive Case Sensitive UTF8MB4 as the default character set Project started in MySQL 5.7 Many improvements to reduce performance impact Copyright 2016, Oracle and/or its affiliates. All rights reserved. 8

New! UUID and Bit- wise Improvements Functions to convert UUID to and from binary: UUID_TO_BIN() BIN_TO_UUID() plus IS_UUID() New! Bit- wise operations on binary data types Bit- wise operations on binary data types Designed with IPv6 in mind: INET6_ATON(address) & INET6_ATON(network) Feature Request from Developers Copyright 2016, Oracle and/or its affiliates. All rights reserved. 9

UUID_TO_BIN Optimization Binary format is now smaller and insert- order efficient: From VARCHAR(36) To VARBINARY(16) 53303f87-78fe- 11e6- a477-8c89a52c4f3b 11e678fe53303f87a4778c89a52c4f3b Insert Performance 25 26 27 28 29 Optimized Original Copyright 2016, Oracle and/or its affiliates. All rights reserved. 10

Continuing the JSON Developer Experience MySQL 8.0 MySQL Document Store Document collections Relational tables Combine them as you like Administer MySQL via the MySQL Shell One stop DevOps tool for MySQL Out of the Box HA Use your preferred language: SQL, JavaScript, Python, Relational or Document Copyright 2016, Oracle and/or its affiliates. All rights reserved. 11

Labs Common Table Expressions With queries Both Recursive and Non- Recursive Forms Simplifies writing complex SQL: Feature Request from Developers WITH t1 AS (SELECT * FROM tbla WHERE a= b ) SELECT * FROM t1; Copyright 2016, Oracle and/or its affiliates. All rights reserved. 12

Recursive CTE WITH RECURSIVE cte AS ( SELECT... FROM table_name /* "seed" SELECT */ UNION ALL SELECT... FROM cte, table_name) /* "recursive" SELECT */ SELECT... FROM cte;/ A recursive CTE refers to itself in a subquery The seed SELECT is executed once to create the initial data subset, the recursive SELECT is repeatedly executed to return subsets of data until the complete result set is obtained. Useful to dig in hierarchies (parent/child, part/subpart) Similar to Oracle's CONNECT BY Copyright 2016, Oracle and/or its affiliates. All rights reserved. 13

Recursive CTE Simple Example Print 1 to 10 : WITH RECURSIVE qn AS ( SELECT 1 AS a UNION ALL SELECT 1+a FROM qn WHERE a<10 ) SELECT * FROM qn; a 1 2 3 4 5 6 7 8 9 10 Copyright 2016, Oracle and/or its affiliates. All rights reserved. 14

InnoDB Auto Increment Persists First reported as BUG #199 Auto increment counters are now written to the REDO log Allows for fast changing meta data Feature Request from DBAs Copyright 2016, Oracle and/or its affiliates. All rights reserved. 15

Labs Descending Indexes For B+tree indexes CREATE TABLE t1 ( a INT, b INT, INDEX a_b (a DESC, b ASC) ); In 5.7: Index in ascending order is created, server scans it backwards In 8.0: Index in descending order is created, server scans it forwards Benefits: Forward index scan is faster than backward index scan Use indexes instead of filesort for ORDER BY clause with ASC/DESC sort key Copyright 2016, Oracle and/or its affiliates. All rights reserved. 16

New! Invisible Indexes Indexes are hidden to the MySQL Optimizer Not the same as disabled indexes Contents are fully up to date and maintained by DML Two use cases: Soft Delete (Recycle Bin) Staged Rollout Feature Request from DBAs Copyright 2016, Oracle and/or its affiliates. All rights reserved. 17

Soft Delete Example Usage I don t think this index is used any more: ALTER TABLE Country ALTER INDEX c INVISIBLE; I need to revert: ALTER TABLE Country ALTER INDEX c VISIBLE; It is now safe to drop: ALTER TABLE Country DROP INDEX c; Copyright 2016, Oracle and/or its affiliates. All rights reserved. 18

Staged Rollout Adding any new index can change existing execution plans. All change introduces risk of regression Invisible indexes allows you to stage all changes i.e. put the database in a prepared state Turn on changes at an opportune time ALTER TABLE Country ADD INDEX c (Continent) INVISIBLE; # after some time ALTER TABLE Country ALTER INDEX c VISIBLE; Copyright 2016, Oracle and/or its affiliates. All rights reserved. 19

SELECT * FROM information_schema.statistics WHERE is_visible='no'; *************************** 1. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: world TABLE_NAME: Country NON_UNIQUE: 1 INDEX_SCHEMA: world INDEX_NAME: c SEQ_IN_INDEX: 1 COLUMN_NAME: Continent COLLATION: A CARDINALITY: 7 SUB_PART: NULL PACKED: NULL NULLABLE: INDEX_TYPE: BTREE COMMENT: disabled INDEX_COMMENT: IS_VISIBLE: NO Copyright 2016, Oracle and/or its affiliates. All rights reserved. 20

New! Security Roles MySQL 8 provides Fully Function, Flexible, Properly Architected Roles DBAs can Create and Drop Roles, Grant to Roles Grant Roles to Roles, Grant Roles to Users Limit Hosts that can use roles, Define Default Roles Decide what roles are applicable during a session And even visualize Roles with SQL function ROLES_GRAPHML() Copyright 2016, Oracle and/or its affiliates. All rights reserved.

New! Atomicity in Privileges Privilege Tables now 100% InnoDB User Management DDLs Atomic CREATE USER ALTER USER RENAME USER DROP USER GRANT REVOKE Copyright 2016, Oracle and/or its affiliates. All rights reserved. 22

New! Performance Schema Indexes Allows for more efficient access to Performance Schema tables Feature Request from DBAs A total of 115 indexes across 93 tables Adds zero overhead A physical index is not maintained internally Implementation of indexes tricks the optimizer into better execution plan Copyright 2016, Oracle and/or its affiliates. All rights reserved. 23

Performance Comparison Over 30x faster! SELECT * FROM sys.session 1000 active sessions Query Time MySQL 8.0 0 5 10 15 20 25 30 35 40 MySQL 5.7 Time in Seconds (Lower is better) Copyright 2016, Oracle and/or its affiliates. All rights reserved. 24

New! Performance Schema Instrumenting SQL Errors Aggregation Table Name By Account events_errors_summary_by_account_by_error By Host events_errors_summary_by_host_by_error By Thread events_errors_summary_by_thread_by_error By User events_errors_summary_by_user_by_error Global events_errors_summary_global_by_error Copyright 2016, Oracle and/or its affiliates. All rights reserved. 25

SELECT * FROM test.no_table; ERROR 1146 (42S02): Table 'test.no_table' doesn't exist SELECT * FROM performance_schema.events_errors_summary_global_by_error WHERE sum_error_handled > 0 OR SUM_ERROR_RAISED > 0\G *************************** 1. row *************************** ERROR_NUMBER: 1146 ERROR_NAME: ER_NO_SUCH_TABLE SQL_STATE: 42S02 SUM_ERROR_RAISED: 1 SUM_ERROR_HANDLED: 0 FIRST_SEEN: 2016-09-11 20:52:42 LAST_SEEN: 2016-09-11 20:52:42 1 row in set (0.00 sec) Copyright 2016, Oracle and/or its affiliates. All rights reserved. 26

New! Persist Configuration Cloud Friendly Persist GLOBAL Dynamic Server Variables SET PERSIST max_connections = 500; Examples Include: Offline_mode Read_Only Requires no filesystem access Copyright 2016, Oracle and/or its affiliates. All rights reserved. 27

New! Variables Info Find the source of variables changed on your installation SELECT * FROM performance_schema.variables_info WHERE variable_source!= 'COMPILED'; +------------------------+-----------------+---------------------+-----------+-----------+ VARIABLE_NAME VARIABLE_SOURCE VARIABLE_PATH MIN_VALUE MAX_VALUE +------------------------+-----------------+---------------------+-----------+-----------+ basedir COMMAND_LINE 0 0 bind_address EXPLICIT [..]/my.sandbox.cnf 0 0 datadir COMMAND_LINE 0 0 foreign_key_checks DYNAMIC 0 0 log_error COMMAND_LINE 0 0 lower_case_table_names EXPLICIT [..]/my.sandbox.cnf 0 2 pid_file COMMAND_LINE 0 0 plugin_dir COMMAND_LINE 0 0 port COMMAND_LINE 0 65535 socket COMMAND_LINE 0 0 tmpdir EXPLICIT [..]/my.sandbox.cnf 0 0 +------------------------+-----------------+---------------------+-----------+-----------+ 11 rows in set (0.00 sec) Copyright 2016, Oracle and/or its affiliates. All rights reserved. 28

New! Transactional Data Dictionary Increased Reliability Using InnoDB internally for data dictionary No FRM files No DB.OPT files No TRG files No TRN files No PAR files MySQL 8.0 default install no longer contains MyISAM tables. Copyright 2016, Oracle and/or its affiliates. All rights reserved. 29

Transactional Data Dictionary Additional Benefits Better cross- platform experience No dependencies on filesystem semantics Atomic DDL Better Replication Simplifies server edge cases MDL for Foreign Keys Flexible Metadata API Easier path to adding new features Copyright 2016, Oracle and/or its affiliates. All rights reserved. 30

Information Schema Performance 100 schemas times 50 tables (5000 tables) Already faster at 7/10 queries in our test suite! Count All Schemas Schema aggregate size stats All Dynamic Table Info All Static Table Info Auto Increments Near Limit MySQL 8.0 MySQL 5.7 Count All Columns Count All Indexes 0 0.5 1 1.5 2 2.5 3 3.5 4 Time in Seconds (Lower is better) Copyright 2016, Oracle and/or its affiliates. All rights reserved. 31

30x Faster SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT FROM information_schema.tables WHERE TABLE_SCHEMA LIKE 'db%'; Test Performed with 100 schemas, each with 50 tables. Copyright 2016, Oracle and/or its affiliates. All rights reserved. 32

All these features and more New! Source code now documented with Doxygen New! Plugin Infrastructure! Expanded GIS Support Expanded Query Hints Support Improved Scan Query Performance Improved BLOB Storage Improved Memcached Interface Cost Model Improvements Scalability Improvements Parser Refactoring Improvements to Temporary Tables C++11 and Toolchain Improvements Replication Applier Thread Progress Reports GTID_PURGED always settable Copyright 2016, Oracle and/or its affiliates. All rights reserved. 33

Copyright 2016, Oracle and/or its affiliates. All rights reserved. 34