What’s New in MySQL 5 · commitment to deliver any material, code, or functionality, and should...

40
<Insert Picture Here> What’s New in MySQL 5.6 杜修文 [email protected] Oracle MySQL Sales Consultant , JAPAC

Transcript of What’s New in MySQL 5 · commitment to deliver any material, code, or functionality, and should...

<Insert Picture Here>

What’s New in MySQL 5.6杜修文 [email protected] MySQL Sales Consultant , JAPAC

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

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.

Safe Harbor Statement

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

UNMATCHED INVESTMENT

HUNDREDS OF EXPERTS

LARGEST MySQL ENGINEERING & SUPPORT ORGANIZATION

LINUX

WINDOWS

NoSQL

InnoDB

REPLICATION

MySQL CLUSTER

MySQL ENTERPRISE EDITION

PERFORMANCE IMPROVEMENTS

WORLD-CLASS SUPPORT WEB

CLOUD

EMBEDDED

STRATEGIC

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

Q2 CY2010 Q3 CY2010 Q4 CY2010 Q1 CY2011

• MySQL Workbench 5.2

GA!

• MySQL Database 5.5 • MySQL Enterprise Backup 3.5• MySQL Enterprise Monitor

2.3• MySQL Cluster Manager 1.1

All GA!

A Better MySQL

Q1 CY2012

•MySQL Enterprise Monitor 2.2•MySQL Cluster 7.1• MySQL Cluster Manager 1.0

All GA!

MySQL Cluster 7.2

GA•MySQL Database 5.6

DMR*

and MySQL Labs!

(“early and often”)

*Development Milestone Release

MySQL 的发展轨迹

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

MySQL Database

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

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

• MySQL 5.6 基於 MySQL 5.5 加上以下的改良 :• Optimizer for better Performance, Scalability• Performance Schema for better instrumentation• InnoDB for better transactional throughput • Replication for higher availability, data integrity• “NotOnlySQL” options for more flexibility

MySQL 5.6: A Better MySQL

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

MySQL 的架构Support for common development languages/platforms

Efficient multi-threaded session handling

Full DML, DDL parsing, cost based optimizer, caching of queries and result sets

Flexible Storage Engine options for application specific storage needs

Flexible logging and physical storage options

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

• Subquery Optimizations• File sort optimizations with small limit

•4X better execution time – 40s to 10s

• Index Condition Pushdown•160X Better execution time – 15s to 90ms

• Postpone Materialization of views/subqueries in FROM•240X better execution time for EXPLAIN – 8m to 2s

• Batched Key Access and Multi Range Read•280X Better execution time – 2800s to 10s

MySQL 5.6: 优化器

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

0 8 16 24 32 40 48 56 645

50

500

5000

1225

9.63

2821

No BKABKA

Join Buffer Size (MB)

Que

ry T

ime

(sec

s)

MySQL 5.6: 优化器Batched Key Access (BKA) & Multi Range Read

Improve performance of disk-bound join queries

Execution time without MRR + BKA

Execution time with MRR + BKA

DBT3 Q13: “Customer Distribution Query”

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

Better Diagnostics and Debugging • EXPLAIN• INSERT, UPDATE, and DELETE• JSON format for better readability

• Persistent Optimizer Statistics - InnoDB• Optimizer Traces

MySQL 5.6: 优化器

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

• Statements/Stages• 那些是耗用资源最多的查询 ? 它们的时间都用在那里 ?

• Table/Index I/O, Table Locks• 那些应用的表 / 索引造成最多的负荷况冲突 ?

• Users/Hosts/Accounts• 那些应用的用户 / 主机 / 程序耗用最多的资源 ?

• Network I/O• 网路的负荷如何 ? 连线的怠机状况如何 ?

• Summaries• 依线程,用户,主机,帐户或物件总合的统计

MySQL 5.6: Performance Schema 的用途Improved Database Profiling/Application Tuning – Less Than 5% Overhead

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

• Better Performance, Scale• Improved thread concurrency, LRU flushing• Reduced contention during file extension• Increase max redo log size• Separate tablespaces for undo log• Fast checksum

• Better Recovery• Dump and restore buffer pool

• Better Usability• Full-text Search• Variable page sizes – 4k, 8k

MySQL 5.6: InnoDBTransactional by Default

> 95% of MySQL apps run InnoDB

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

MySQL 的复制

MySQL Master

relaybinlog

MySQL Slave

mysqld

data

index &binlogs

databinlog

updatesselects

updates

mysqld

I/O Thread

SQL Thread

Replication

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

MySQL 5.6: 复制Largest EVER set of Enhancements

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

5x Higher Replication Performance

• SysBench, running across 10 x schemas

• Oracle Linux 6.1, Oracle Sun Fire x4150 m2 Server

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

全域事务代码

• Simple to track & compare replication across the cluster– Unique identifier for each transaction written to the Binlog

• Automatically identify the most up-to-date slave for failover

• Deploy n-tier replication hierarchies

Master

GTID=123456

GTID=123457

GTID=123456 GTID=123455

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

• 促成自我療愈複製的結構

• 自動固障移轉和恢復– mysqlfailover Utility

• 切換和管理– mysqlrpladmin Utility

• Delivers HA within the core MySQL distribution– 不需要第三方的解決方案 – 能加以擴充以支持各種高可用機制

HA UtilitiesMonitoring

FailedMaster

Slaves

PromotedMaster

Replication HA Utilities

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

• Check: Verifying pre-requisites for Replication

• Repl: Initiating Replication to the new slave

• Show: Displaying Replication topology

• HA: Detecting and failing-over from master to slave. Monitoring status.

• Implemented as Python scripts– Available from LaunchPad or as a plug-in for MySQL Workbench– Extensible to include custom scripting

Check Repl Show HA

Growing Suite of MySQL Utilities Workflow for Replication

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

Evaluate MySQL 5.6 TODAY

dev.mysql.com/downloads/mysqlSelect Development Release tab

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

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

• “NotOnlySQL” Key-value access to InnoDB data• Online Operations (INDEX add, FK Drop, Column rename)....more to come• Removal of LOCK_open as a bottleneck• Removal of CPU cache sharings as a bottleneck• Improved InnoDB flushing

InnoDB Early Access Features

Try it Today!labs.mysql.com/

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

InnoDB 效能的改進

0

2000

4000

6000

8000

10000

12000

24 32 64 96 128

Que

ries

perS

econ

d

Threads

MySQL 5.6.5

MySQL 5.6.June

• Up to 2.8x higher performance• Removal of LOCK_open• Removal of CPU cache

sharings• InnoDB flushing

• Sysbench R/W• 8 x Socket / 6-core Intel

Xeon 7540, 2GHz• 512GB RAM • SSD

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

• Fast, simple access to InnoDB• via Memcached API• Use existing Memcached clients• Bypasses SQL parsing

• NotOnlySQL access• For key-value operations

• SQL for rich queries, JOINs, FKs, etc.

• Implementation• Memcached plug-in to mysqld • Memcached mapped to native InnoDB

API• Shared process for ultra-low latency

InnoDB Storage Engine

MySQL Server Memcached plugin

ApplicationSQL

(MySQL Client)NoSQL (Memcached Protocol)

mysqld

Key-value Access to InnoDB Data

Try it Today!labs.mysql.com/

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

• Increases performance

• Commits multiple transactions as a group to Binlog on disk

Session

Binary Log

Master Database

T1 T2

T3 T4

Groupcommit

New Today!

Try it Today!labs.mysql.com/

Binary Log Group Commit Early Access Features

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

Binary Log Group Commit Performance

• Up to 2.3x with binlog configured versus 5.6.5 with no binlog

• Up to 3.5x faster with binlog configured

• Sysbench R/W• 8 x Socket / 6-core Intel

Xeon 7540, 2GHz• 512GB RAM • SSD

Sync_binlog = 1

New Today!

0

1000

2000

3000

4000

5000

6000

7000

8000

9000

10000

24 32 64 96 128

Que

ries

perS

econ

d

Threads

MySQL 5.6.5 - NoBinlog

MySQL 5.6.5 -sync_binlog = 1

MySQL 5.6 June -sync_binlog = 1

MySQL 5.6 June – sync_binlog = 1

MySQL 5.6. – No Binlog

MySQL 5.6.5 – sync_binlog = 1

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

Binary Log Group Commit Performance Impact

• 11% average with sync_binlog = 0

• 0%-10% with sync_binlog = 1 above 48 threads• 20% at lower thread counts

• Sysbench R/W• 8 x Socket / 6-core Intel Xeon

7540, 2GHz• 512GB RAM • SSD

New Today!

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

• Optimizer: Up to 280X Better Execution Time• Replication: Up to 5X Higher Performance, Self-Healing• InnoDB: Better Performance, Scalability, NoSQL,

Recovery and Usability• Plus, Performance Schema, MySQL Utilities

MySQL 5.6: A Better MySQL

Best Open Source Product 2011 Award by CRN“MySQL 5.6 … includes significant advances in text-based search inside a database, as well as performance enhancements... MySQL 5.6 is firmly in place as the strongest open-source database.”

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

MySQL Cluster

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

MySQL Cluster 7.2Fastest Growing Release EVER

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

• 1 Billion+ Reads per Minute, 8 node Intel Xeon cluster

• NoSQL C++ API, flexaSynch benchmark

• Multi-Threaded Data Node Extensions

比較兩個 MySQL Cluster 版本間的效能8x Higher Performance per Node

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

• 30 x Intel E5-2600 Intel Servers

• NoSQL C++ API, flexaSynch benchmark

• ACID Transactions, with Synchronous Replication

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

• Foreign Keys - Design Goal: compatibility to InnoDB- Natively implemented in the data layer- Accessible from SQL and NoSQL access layer- Online add/drop foreign keys

MySQL Cluster 7.3 Early Access Features

Try it Today -- labs.mysql.com

Blending SQL & NoSQL

New Today!

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

Integration with Oracle Productand MySQL Enterprise Edition

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

Oracle Premier SupportOracle Product

Certifications

MySQL Enterprise High Availability

MySQL Enterprise Security

MySQL Enterprise Scalability

MySQL Enterprise Backup

MySQL Enterprise Monitor/Query Analyzer

MySQL Workbench

MySQL Enterprise EditionEnables you to manage your Oracle and MySQL databases with Oracle tools/solutions you are already using.

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

MySQL Enterprise Monitor• Global view of MySQL environment

• Automated, rules-based monitoring and alerts (SMTP, SNMP enabled)

• Query capture, monitoring, analysis and tuning, correlated with Monitor graphs

• Visual monitoring of “hot” applications and servers

• Replication Monitor with auto-discovery of master-slave topologies

• Integrated with MySQL Support

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

MySQL Enterprise Backup

• Online Backup for InnoDB

• Full, Incremental, Partial Backups (scriptable interface)

• Compression

• Point in Time, Full, Partial Recovery options

• Metadata on status, progress, history

• Unlimited Database Size

• Cross-Platform• Windows, Linux, Unix

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

MySQL Enterprise Backup

• Oracle Secure Backup• MySQL Enterprise Backup images to tape (like RMAN)• Via SBT interface (standard for MMS)• Encryption, policy-based management, vault rotation• Common SOP for Oracle, MySQL backups

mysqlbackup

--port=3306

--protocol=tcp

--user=root

--password

--backup-image=sbt:backup-shoeprod-2011-10-02

--backup-dir=/backup backup-to-image

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

ORACLE DRIVES MySQL INNOVATION

BEST OF BREED SOLUTIONS FOR NEXT GENERATION WEB APPLICATIONS

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