SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Seminar:
What's new in MySQL 5.6?

Presenter:     Shlomi Noach
Oracle ACE
MySQL Community Member
http://openark.org




                                                          2
                              copyright (c) 2012 Shlomi Noach
The state of MySQL 5.6
●
    MySQL 5.6 is being under development
    since early 2011
●
    Uses a milestone based release model:
    milestone features are assumed to have
    RC quality
●
    5.6.7 (Release Candidate) recently
    announced

                                                                3
                                    copyright (c) 2012 Shlomi Noach
The state of MySQL 5.6
●   While 5.5 (first release under Oracle's stewardship)
    was focused on performance, scale up and integrity,
    and had little focus on new features, 5.6 offers:
    –   Loads of new usability features
    –   Major improvements to InnoDB architecture
    –   Optimizer enhancements
    –   Major replication improvements
    –   PERFORMANCE_SCHEMA: dozens new tables




                                                                                4
                                                    copyright (c) 2012 Shlomi Noach
New in MySQL 5.6
●   We discuss new & noteworthy under the
    following:
    –   InnoDB
    –   Replication
    –   Optimizer
    –   Partitioning




                                                              5
                                  copyright (c) 2012 Shlomi Noach
InnoDB
●   Once acquired both InnoBase and Sun
    Microsystems, Oracle directed more
    resources at InnoDB development as
    integral part of MySQL
●   InnoDB is today the default storage engine
    for MySQL
●   5.6 brings new usability, maintainability
    and performance improvements to InnoDB

                                                                 6
                                     copyright (c) 2012 Shlomi Noach
InnoDB: online DDL
 ●   Arguably the #1 reason one would want to
     upgrade to 5.6
 ●   InnoDB now supports online, non-blocking
     ALTER TABLE operations for many DDL
     statements:
      –   ADD/MODIFY/DROP COLUMN, ADD/DROP INDEX,
          ADD/DROP Foreign Keys, change of
          AUTO_INCREMENT, change of row format,
          compression, and more.
http://dev.mysql.com/doc/refman/5.6/en/innodb-online-ddl.html




                                                                                            7
                                                                copyright (c) 2012 Shlomi Noach
InnoDB: FULLTEXT
 ●   FULLTEXT indexes now available on InnoDB
 ●   Support same syntax as with MyISAM
      –   Boolean search
      –   Stopwords
      –   Proximity
 ●   Fills the last gap for MyISAM users to migrate to
     InnoDB
http://dev.mysql.com/doc/refman/5.6/en/innodb-table-and-index.html#innodb-fulltext-index




                                                                                                                       8
                                                                                           copyright (c) 2012 Shlomi Noach
InnoDB: Transportable tables
 ●   “move around” InnoDB tables by copying them via
     file system
 ●   Allows for fast table duplicate; fast export of table
     between servers
 ●   via:
      –   FLUSH TABLES … FOR EXPORT
      –   ALTER TABLE … DISCARD TABLESPACE
      –   ALTER TABLE … IMPORT TABLESPACE
http://blogs.innodb.com/wp/2012/04/innodb-transportable-tablespaces/




                                                                                                   9
                                                                       copyright (c) 2012 Shlomi Noach
InnoDB: NoSQL access
 ●   It is possible to access InnoDB via memcache API
     –   Uses embedded memcached server
     –   Via standard memcache clients
     –   No need for SQL, avoids parsing, preparing, QEP evaluation
           ●   However fully utilizing transactions; ACID compliant!
     –   At current supporting single table
     –   memcache writes batched; may require READ
         UNCOMMITED on SQL side
http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached.html




                                                                                                   10
                                                                       copyright (c) 2012 Shlomi Noach
InnoDB: performance
●   InnoDB 5.6 performance improvements include:
    –   Preloading buffer pool (cache flush to disk)
    –   Adaptive REDO logs flushing
    –   Better, more concurrent buffer flushing
    –   Configurable tablespace location
    –   UNDO logs on separate tablespace
    –   Persistent stats
    –   More...



                                                                                   11
                                                       copyright (c) 2012 Shlomi Noach
Partitions
●   Introduced in 5.1
●   Features RANGE, LIST, HASH & KEY partitioning
    –   5.1 RANGE and LIST limited to integer partitioning keys
●   5.5 introduced:
    –   RANGE COLUMNS and LIST COLUMNS partitioning,
        removing said limitation
    –   ALTER TABLE … TRUNCATE PARTITION
●   5.6 boasts major partition improvements




                                                                                    12
                                                        copyright (c) 2012 Shlomi Noach
Partition exchange
 ●   Swap a partition with a table of the exact
     same structure
      –   Either or both may contain data
      –   Allows for quick insertion or extraction of data
          into/from partitioned table
           ●   via:
               ALTER TABLE part_tbl
               EXCHANGE PARTITION part_name WITH TABLE tbl;
http://dev.mysql.com/doc/refman/5.6/en/partitioning-management-exchange.html




                                                                                                           13
                                                                               copyright (c) 2012 Shlomi Noach
Explicit partition selection
 ●   Limit a DML statement to a specific partition or set
     of partitions
      –   Similar to partition pruning, but manual, and applies for
          SELECT, UPDATE, INSERT, REPLACE, DELETE,
          LOAD
      –   Avoid partition lookup on complex search terms, or
          otherwise based on known heuristic
            ●   via:
                UPDATE tbl PARTITION (p2, p3, p5) SET c=1 WHERE
                condition_holds
http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html




                                                                                                 14
                                                                     copyright (c) 2012 Shlomi Noach
Partitions: lock pruning
 ●   Ever since partitions were introduced in 5.1, locking has
     been an issue
 ●   Even with partition pruning, locks were held over all table
     partitions
      –   And although InnoDB uses row-level locking and is supposedly
          unaffected by table locks, the lock mechanism is still invoked
      –   This caused for a known scenario of reduced performance on
          intensive INSERTs to a partitioned table
 ●   With 5.6 this is alleviated; locks are expected to be
     placed only on relevant partitions.
http://dev.mysql.com/doc/refman/5.6/en/partitioning-limitations-locking.html




                                                                                                           15
                                                                               copyright (c) 2012 Shlomi Noach
Execution plans
●   Query Execution Plan (QEP) is boosted in
    5.6 both internally (optimized plans) and
    usability-wise
●   Some notorious limitations are removed,
    and infamous QEP scenarios now fixed




                                                                16
                                    copyright (c) 2012 Shlomi Noach
Execution plans: subqueries
 ●   Up till 5.5, subqueries & derived tables:
      –   Evaluated as non-indexed temporary tables
      –   Would, in common scenarios, re-evaluate throughout the query
 ●
     select * from actor where actor_id in
     (select actor_id from film_actor where film_id = 7)
 ●
     5.6 introduces:
      –   Indexes on derived tables
      –   Semijoins avoid re-evaluation and skip execution phases
https://dev.mysql.com/doc/refman/5.6/en/semi-joins.html




                                                                                        17
                                                            copyright (c) 2012 Shlomi Noach
Execution plans: indexes
 ●
     Index optimizations include:
      –   Index condition pushdown: better execution plans
          for queries where index can satisfy conditions
           ●
               This reduces MySQL-SE data transfer and allows for
               storage engine internal handling of conditions.
      –   Improved index merge
https://dev.mysql.com/doc/refman/5.6/en/index-condition-pushdown-optimization.html

http://dev.mysql.com/doc/refman/5.6/en/index-merge-optimization.html




                                                                                                            18
                                                                                copyright (c) 2012 Shlomi Noach
Execution plans: EXPLAIN
 ●   EXPLAIN will now work on INSERT,
     UPDATE & DELETE statements
      –   Previously only on SELECT
      –   Hacks used to convert UPDATE/DELETE
          statements into SELECT statements so as to
          guess QEP. The result was not authoritative.
http://dev.mysql.com/doc/refman/5.6/en/explain.html




                                                                                  19
                                                      copyright (c) 2012 Shlomi Noach
Execution plans: EXPLAIN
 ●   EXPLAIN FORMAT=JSON is introduced
      –   Presenting execution plan in a JSON-tree format
      –   Much more accurate output than EXPLAIN
      –   Easy to parse and diagnose by automated tools
 ●   Optimizer trace presents with actual execution steps
     taken after fact
      –   Also in JSON format
http://dev.mysql.com/doc/internals/en/optimizer-tracing.html




                                                                                           20
                                                               copyright (c) 2012 Shlomi Noach
Replication
●   New replication features make for:
    –   Faster replication
    –   Safer replication
    –   Easier to maintain replication




                                                                     21
                                         copyright (c) 2012 Shlomi Noach
Replication: GTID
 ●   Global Transaction IDs are introduced into the binary logs,
     such that every statement has a globally unique ID
 ●   A slave can connect to its master and auto-detect binlog
     position via GTID
 ●   Easier to failover to another slave, or to move slaves along
     replication tree
 ●   via:
     CHANGE MASTER TO MASTER_AUTO_POSITION = 1
http://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html




                                                                                            22
                                                                copyright (c) 2012 Shlomi Noach
Multithreaded slaves
 ●   Based on a thread-per-database
      –   Assumes different schemas completely unrelated
 ●   Multithreaded replication breaks the years-old
     “single threaded slave” paradigm
      –   In this paradigm a slave had to do all master's work
          utilizing one thread only
      –   Very quickly leads to replication lag issues
https://blogs.oracle.com/MySQL/entry/benchmarking_mysql_replication_with_multi




                                                                                                             23
                                                                                 copyright (c) 2012 Shlomi Noach
Crashsafe replication
 ●   “Standard” replication uses master.info and relay-
     log.info files to manage records of current
     replication status
      –   These files not flushed to disk upon update
      –   Cause for replication break (or worse – integrity loss)
 ●   With 5.6, replication status can be written to system
     InnoDB tables
      –   Being transactional, these are fully ACID
http://mysqlmusings.blogspot.co.il/2011/04/crash-safe-replication.html




                                                                                                     24
                                                                         copyright (c) 2012 Shlomi Noach
Replication: more
 ●   Time delayed replication available via
     CHANGE MASTER TO MASTER_DELAY=...
 ●   Binary log checksums allow for safer log transfer between
     hosts
 ●   New set of utilities allows for easier replication maintenance
 ●   Optimized row-based replication: only transfer actual row
     changes, not complete changed row
http://dev.mysql.com/tech-resources/articles/mysql-5.6-replication.html




                                                                                                      25
                                                                          copyright (c) 2012 Shlomi Noach
Thank you!
●   I blog at http://openark.org
●   Free and open source projects:
    –   common_schema: DBA's framework for
        MySQL
    –   openark-kit: common utilities for MySQL
    –   mycheckpoint: lightweight, SQL oriented
        monitoring for MySQL
●   shlomi[at]openark.org

                                                                        26
                                            copyright (c) 2012 Shlomi Noach
27
copyright (c) 2012 Shlomi Noach

Contenu connexe

Tendances

Tendances (20)

Yahoo: Experiences with MySQL GTID and Multi Threaded Replication
Yahoo: Experiences with MySQL GTID and Multi Threaded ReplicationYahoo: Experiences with MySQL GTID and Multi Threaded Replication
Yahoo: Experiences with MySQL GTID and Multi Threaded Replication
 
MySQL Replication Troubleshooting for Oracle DBAs
MySQL Replication Troubleshooting for Oracle DBAsMySQL Replication Troubleshooting for Oracle DBAs
MySQL Replication Troubleshooting for Oracle DBAs
 
How Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lagHow Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lag
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting Replication
 
M|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsM|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change Methods
 
MySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsMySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitations
 
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorAlmost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
MySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comMySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.com
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
 
MongoDB Engines: Demystified
MongoDB Engines: DemystifiedMongoDB Engines: Demystified
MongoDB Engines: Demystified
 
MySQL 5.6 GTID in a nutshell
MySQL 5.6 GTID in a nutshellMySQL 5.6 GTID in a nutshell
MySQL 5.6 GTID in a nutshell
 
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1
 
Riding the Binlog: an in Deep Dissection of the Replication Stream
Riding the Binlog: an in Deep Dissection of the Replication StreamRiding the Binlog: an in Deep Dissection of the Replication Stream
Riding the Binlog: an in Deep Dissection of the Replication Stream
 

Similaire à What's new in MySQL 5.6

Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
Tarique Saleem
 
Ukoug 2011 mysql_arch_for_orcl_dba
Ukoug 2011 mysql_arch_for_orcl_dbaUkoug 2011 mysql_arch_for_orcl_dba
Ukoug 2011 mysql_arch_for_orcl_dba
orablue11
 
01 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv101 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv1
Ivan Ma
 
My sql vivo_5.5_product_update_pt
My sql  vivo_5.5_product_update_ptMy sql  vivo_5.5_product_update_pt
My sql vivo_5.5_product_update_pt
MySQL Brasil
 
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
Insight Technology, Inc.
 

Similaire à What's new in MySQL 5.6 (20)

Percona 服务器与 XtraDB 存储引擎
Percona 服务器与 XtraDB 存储引擎Percona 服务器与 XtraDB 存储引擎
Percona 服务器与 XtraDB 存储引擎
 
MySQL Tech Tour 2015 - 5.7 InnoDB
MySQL Tech Tour 2015 - 5.7 InnoDBMySQL Tech Tour 2015 - 5.7 InnoDB
MySQL Tech Tour 2015 - 5.7 InnoDB
 
MySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksMySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disks
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDB
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 
MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014)
 
Ukoug 2011 mysql_arch_for_orcl_dba
Ukoug 2011 mysql_arch_for_orcl_dbaUkoug 2011 mysql_arch_for_orcl_dba
Ukoug 2011 mysql_arch_for_orcl_dba
 
01 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv101 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv1
 
OpenERP 6.1 Framework Changes
OpenERP 6.1 Framework ChangesOpenERP 6.1 Framework Changes
OpenERP 6.1 Framework Changes
 
My sql vivo_5.5_product_update_pt
My sql  vivo_5.5_product_update_ptMy sql  vivo_5.5_product_update_pt
My sql vivo_5.5_product_update_pt
 
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
 
Nuxeo World Keynote: Roadmap - What to Expect from Nuxeo in 2011
Nuxeo World Keynote: Roadmap - What to Expect from Nuxeo in 2011Nuxeo World Keynote: Roadmap - What to Expect from Nuxeo in 2011
Nuxeo World Keynote: Roadmap - What to Expect from Nuxeo in 2011
 
State of the Dolphin, at db tech showcase Osaka 2014
State of the Dolphin, at db tech showcase Osaka 2014State of the Dolphin, at db tech showcase Osaka 2014
State of the Dolphin, at db tech showcase Osaka 2014
 
Ceph Day New York: Ceph: one decade in
Ceph Day New York: Ceph: one decade inCeph Day New York: Ceph: one decade in
Ceph Day New York: Ceph: one decade in
 
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph
 
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
 
What is new in MariaDB 10.6?
What is new in MariaDB 10.6?What is new in MariaDB 10.6?
What is new in MariaDB 10.6?
 

Dernier

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Dernier (20)

Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 

What's new in MySQL 5.6

  • 1. Seminar: What's new in MySQL 5.6? Presenter: Shlomi Noach Oracle ACE MySQL Community Member http://openark.org 2 copyright (c) 2012 Shlomi Noach
  • 2. The state of MySQL 5.6 ● MySQL 5.6 is being under development since early 2011 ● Uses a milestone based release model: milestone features are assumed to have RC quality ● 5.6.7 (Release Candidate) recently announced 3 copyright (c) 2012 Shlomi Noach
  • 3. The state of MySQL 5.6 ● While 5.5 (first release under Oracle's stewardship) was focused on performance, scale up and integrity, and had little focus on new features, 5.6 offers: – Loads of new usability features – Major improvements to InnoDB architecture – Optimizer enhancements – Major replication improvements – PERFORMANCE_SCHEMA: dozens new tables 4 copyright (c) 2012 Shlomi Noach
  • 4. New in MySQL 5.6 ● We discuss new & noteworthy under the following: – InnoDB – Replication – Optimizer – Partitioning 5 copyright (c) 2012 Shlomi Noach
  • 5. InnoDB ● Once acquired both InnoBase and Sun Microsystems, Oracle directed more resources at InnoDB development as integral part of MySQL ● InnoDB is today the default storage engine for MySQL ● 5.6 brings new usability, maintainability and performance improvements to InnoDB 6 copyright (c) 2012 Shlomi Noach
  • 6. InnoDB: online DDL ● Arguably the #1 reason one would want to upgrade to 5.6 ● InnoDB now supports online, non-blocking ALTER TABLE operations for many DDL statements: – ADD/MODIFY/DROP COLUMN, ADD/DROP INDEX, ADD/DROP Foreign Keys, change of AUTO_INCREMENT, change of row format, compression, and more. http://dev.mysql.com/doc/refman/5.6/en/innodb-online-ddl.html 7 copyright (c) 2012 Shlomi Noach
  • 7. InnoDB: FULLTEXT ● FULLTEXT indexes now available on InnoDB ● Support same syntax as with MyISAM – Boolean search – Stopwords – Proximity ● Fills the last gap for MyISAM users to migrate to InnoDB http://dev.mysql.com/doc/refman/5.6/en/innodb-table-and-index.html#innodb-fulltext-index 8 copyright (c) 2012 Shlomi Noach
  • 8. InnoDB: Transportable tables ● “move around” InnoDB tables by copying them via file system ● Allows for fast table duplicate; fast export of table between servers ● via: – FLUSH TABLES … FOR EXPORT – ALTER TABLE … DISCARD TABLESPACE – ALTER TABLE … IMPORT TABLESPACE http://blogs.innodb.com/wp/2012/04/innodb-transportable-tablespaces/ 9 copyright (c) 2012 Shlomi Noach
  • 9. InnoDB: NoSQL access ● It is possible to access InnoDB via memcache API – Uses embedded memcached server – Via standard memcache clients – No need for SQL, avoids parsing, preparing, QEP evaluation ● However fully utilizing transactions; ACID compliant! – At current supporting single table – memcache writes batched; may require READ UNCOMMITED on SQL side http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached.html 10 copyright (c) 2012 Shlomi Noach
  • 10. InnoDB: performance ● InnoDB 5.6 performance improvements include: – Preloading buffer pool (cache flush to disk) – Adaptive REDO logs flushing – Better, more concurrent buffer flushing – Configurable tablespace location – UNDO logs on separate tablespace – Persistent stats – More... 11 copyright (c) 2012 Shlomi Noach
  • 11. Partitions ● Introduced in 5.1 ● Features RANGE, LIST, HASH & KEY partitioning – 5.1 RANGE and LIST limited to integer partitioning keys ● 5.5 introduced: – RANGE COLUMNS and LIST COLUMNS partitioning, removing said limitation – ALTER TABLE … TRUNCATE PARTITION ● 5.6 boasts major partition improvements 12 copyright (c) 2012 Shlomi Noach
  • 12. Partition exchange ● Swap a partition with a table of the exact same structure – Either or both may contain data – Allows for quick insertion or extraction of data into/from partitioned table ● via: ALTER TABLE part_tbl EXCHANGE PARTITION part_name WITH TABLE tbl; http://dev.mysql.com/doc/refman/5.6/en/partitioning-management-exchange.html 13 copyright (c) 2012 Shlomi Noach
  • 13. Explicit partition selection ● Limit a DML statement to a specific partition or set of partitions – Similar to partition pruning, but manual, and applies for SELECT, UPDATE, INSERT, REPLACE, DELETE, LOAD – Avoid partition lookup on complex search terms, or otherwise based on known heuristic ● via: UPDATE tbl PARTITION (p2, p3, p5) SET c=1 WHERE condition_holds http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html 14 copyright (c) 2012 Shlomi Noach
  • 14. Partitions: lock pruning ● Ever since partitions were introduced in 5.1, locking has been an issue ● Even with partition pruning, locks were held over all table partitions – And although InnoDB uses row-level locking and is supposedly unaffected by table locks, the lock mechanism is still invoked – This caused for a known scenario of reduced performance on intensive INSERTs to a partitioned table ● With 5.6 this is alleviated; locks are expected to be placed only on relevant partitions. http://dev.mysql.com/doc/refman/5.6/en/partitioning-limitations-locking.html 15 copyright (c) 2012 Shlomi Noach
  • 15. Execution plans ● Query Execution Plan (QEP) is boosted in 5.6 both internally (optimized plans) and usability-wise ● Some notorious limitations are removed, and infamous QEP scenarios now fixed 16 copyright (c) 2012 Shlomi Noach
  • 16. Execution plans: subqueries ● Up till 5.5, subqueries & derived tables: – Evaluated as non-indexed temporary tables – Would, in common scenarios, re-evaluate throughout the query ● select * from actor where actor_id in (select actor_id from film_actor where film_id = 7) ● 5.6 introduces: – Indexes on derived tables – Semijoins avoid re-evaluation and skip execution phases https://dev.mysql.com/doc/refman/5.6/en/semi-joins.html 17 copyright (c) 2012 Shlomi Noach
  • 17. Execution plans: indexes ● Index optimizations include: – Index condition pushdown: better execution plans for queries where index can satisfy conditions ● This reduces MySQL-SE data transfer and allows for storage engine internal handling of conditions. – Improved index merge https://dev.mysql.com/doc/refman/5.6/en/index-condition-pushdown-optimization.html http://dev.mysql.com/doc/refman/5.6/en/index-merge-optimization.html 18 copyright (c) 2012 Shlomi Noach
  • 18. Execution plans: EXPLAIN ● EXPLAIN will now work on INSERT, UPDATE & DELETE statements – Previously only on SELECT – Hacks used to convert UPDATE/DELETE statements into SELECT statements so as to guess QEP. The result was not authoritative. http://dev.mysql.com/doc/refman/5.6/en/explain.html 19 copyright (c) 2012 Shlomi Noach
  • 19. Execution plans: EXPLAIN ● EXPLAIN FORMAT=JSON is introduced – Presenting execution plan in a JSON-tree format – Much more accurate output than EXPLAIN – Easy to parse and diagnose by automated tools ● Optimizer trace presents with actual execution steps taken after fact – Also in JSON format http://dev.mysql.com/doc/internals/en/optimizer-tracing.html 20 copyright (c) 2012 Shlomi Noach
  • 20. Replication ● New replication features make for: – Faster replication – Safer replication – Easier to maintain replication 21 copyright (c) 2012 Shlomi Noach
  • 21. Replication: GTID ● Global Transaction IDs are introduced into the binary logs, such that every statement has a globally unique ID ● A slave can connect to its master and auto-detect binlog position via GTID ● Easier to failover to another slave, or to move slaves along replication tree ● via: CHANGE MASTER TO MASTER_AUTO_POSITION = 1 http://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html 22 copyright (c) 2012 Shlomi Noach
  • 22. Multithreaded slaves ● Based on a thread-per-database – Assumes different schemas completely unrelated ● Multithreaded replication breaks the years-old “single threaded slave” paradigm – In this paradigm a slave had to do all master's work utilizing one thread only – Very quickly leads to replication lag issues https://blogs.oracle.com/MySQL/entry/benchmarking_mysql_replication_with_multi 23 copyright (c) 2012 Shlomi Noach
  • 23. Crashsafe replication ● “Standard” replication uses master.info and relay- log.info files to manage records of current replication status – These files not flushed to disk upon update – Cause for replication break (or worse – integrity loss) ● With 5.6, replication status can be written to system InnoDB tables – Being transactional, these are fully ACID http://mysqlmusings.blogspot.co.il/2011/04/crash-safe-replication.html 24 copyright (c) 2012 Shlomi Noach
  • 24. Replication: more ● Time delayed replication available via CHANGE MASTER TO MASTER_DELAY=... ● Binary log checksums allow for safer log transfer between hosts ● New set of utilities allows for easier replication maintenance ● Optimized row-based replication: only transfer actual row changes, not complete changed row http://dev.mysql.com/tech-resources/articles/mysql-5.6-replication.html 25 copyright (c) 2012 Shlomi Noach
  • 25. Thank you! ● I blog at http://openark.org ● Free and open source projects: – common_schema: DBA's framework for MySQL – openark-kit: common utilities for MySQL – mycheckpoint: lightweight, SQL oriented monitoring for MySQL ● shlomi[at]openark.org 26 copyright (c) 2012 Shlomi Noach
  • 26. 27 copyright (c) 2012 Shlomi Noach