SlideShare a Scribd company logo
1




               <Insert Picture Here>




        The MySQL Roadmap: Discover What’s New
        April, 2012
        杜修文 Ivan.Tu@Oracle.Com, Oracle MySQL Sales Consultant
    CONFIDENTIAL – ORACLE HIGHLY RESTRICTED
Safe Harbor Statement
以下內容旨在概述產品的整體方向。僅供參考,不
得納入任何合約。這份簡報不是承諾提供任何材
料,代碼或功能,並且不應當作購買決策的依據。
甲骨文公司保有對其產品所描述的任何特性或開發
的功能,和發佈時間的權利。




                  2
Oracle 對 MySQL 的投資
加速創新
使 MySQL 成為更好的 MySQL
• #1 Open Source Database for Web Applications
• “M” in most complete LAMP stack
• Embedded

開發 , 推廣和支持 MySQL
• Improved engineering, consulting and support
• Leverage 24x7, World-Class Oracle Support

MySQL 社群版
• Source and binary releases
• GPL license




                           3
比以前推出更多的產品
   帶動 MySQL                   • MySQL Enterprise Backup 3.7
                              • Oracle VM Template for
     創新                         MySQL Enterprise Edition
                              • MySQL Enterprise Oracle
                                Certifications              • MySQL Cluster 7.2
• MySQL Enterprise Monitor
                              • MySQL Windows Installer      • MySQL Cluster
  2.2
                              • New MySQL Enterprise            Manager 1.4
• MySQL Cluster 7.1
                                Commercial Extensions        • MySQL Utilities
• MySQL Cluster Manager 1.0
                                                                   1.0.6
• MySQL Workbench 5.2                 All GA!                     All GA!
• MySQL Database 5.5
• MySQL Enterprise Backup
  3.5                         • MySQL Database 5.6 DMR*     • MySQL Database
• MySQL Enterprise Monitor    • MySQL Cluster 7.2 DMR             5.6.5 DMR*
  2.3                              and MySQL Labs!            and MySQL Labs!
• MySQL Cluster Manager 1.1       (“early and often”)        (“early and often”)
          All GA!

                                                      A Better MySQL
                                                  *Development Milestone Release

           CY2010                       4
                                        CY2011                    Q1 CY2012
MySQL 5.5 – Best Release Ever
InnoDB 是預設的 storage engine
• ACID Transactions, FKs, Crash Recovery

效能的改善
•   Enhancements in MySQL DB
•   Enhancements in InnoDB
•   + 360% over 5.1 on Linux
•   + 1500% over 5.1 on Windows
可用率的改善
• Semi-synchronous Replication
• Replication Heartbeat
便利性的改善
• SIGNAL/RESIGNAL
• More Partitioning Options
• New PERFORMANCE_SCHEMA

                                  5
MySQL 5.5 Scales On Multi-Core
                         SysBench Read Write



                                                                                MySQL 5.5.4
Transactions/Second




                                                                                MySQL 5.5.3




                                                                                MySQL 5.1




                                                   AMD Opteron 7160 (Magny-Cours) @2100 MHz
                                                   64 GB memory
                                                   2 x Intel X25E SSD drives
                                                   OS is Oracle Enterprise Linux with the Enterprise Kernel
                                               6   4 sockets with a total of 48 cores.
MySQL “Early Access” 發佈模式
Database and Cluster

Model: Development Milestone Releases (“DMR”)
  • 每 3-6 個用一版新的 DMR
  • 每一版 DMR 累積一些新功能到下一個正式版 (5.6)
  • 新功能整合到穩定 lunchpad 主版
  • 所有的功能由 QA 一起測試和簽發
  • 接近正式版的品質
  • 再一個 DMR 後收進的功能就是正式版

Model: MySQL Labs 的“早期使用”功能
  • 預覽 , 不在 lunchpage 主版 (trunk)
  • 不保證出現在正式版




                       7
MySQL Database 5.6: 一個更好的 MySQL.
• MySQL 5.6 在 MySQL 5.5 上再加以改進 :
  • Performance and Scalability
  • Optimizer for better query execution times, diagnostics
  • Performance Schema for better instrumentation
  • InnoDB for better transactional throughput
  • Replication for higher availability, data integrity
  • “NotOnlySQL” options for better flexibility
• 5.6.5 DMR – April, 2012




         dev.mysql.com/downloads/mysql/

                              8
MySQL 5.6.5 – 優化器的改進

  • Subquery Optimizations
  • File sort optimizations with small limit
    • 3X better execution time – 40s to 10s
• Index Condition Pushdown
    • Better execution time – 15s to 90ms
• Batched Key Access and Multi Range Read
    • Better execution time – 2000s to 10s
• Postpone Materialization of views/subqueries in FROM
    • 240X better execution time for EXPLAIN - 8m to 2s




                            9
MySQL 5.6.5 – 優化器的改善

Better Diagnostics and Debugging
  • EXPLAIN
  • INSERT, UPDATE, and DELETE
  • JSON format for better readability
• Persistent Optimizer Statistics - InnoDB
• Optimizer Traces




                             10
MySQL 5.6.5 – 優化器的改善
    Index Condition Pushdown (ICP)

CREATE TABLE person (
      personid INTEGER PRIMARY KEY,
      firstname CHAR(20),
      lastname CHAR(20),
   pe test
      postalcode INTEGER,
   r  age INTEGER,
      address CHAR(50),
      KEY k1 (postalcode,age)
   ) ENGINE=InnoDB;




SELECT lastname, firstname FROM person
   WHERE postalcode BETWEEN 5000 AND 5500 AND age BETWEEN 21 AND 22;


• With ICP Disabled               • With ICP Enabled
   • 15 s (buffer pool 128 Mb)      ⇒ Execution time drops to 90 ms for both
   • 1.4 s (buffer pool 1.5 Gb)


                                     11
MySQL 5.6.5 – 優化器的改善
Batched Key Access (BKA) 和 Multi Range Read
Improves performance of disk-bound join queries
                    5000
                     2821
                                                                                    Execution time
                                                                                    without BKA + MRR
                     1225


                     500
Query Time (secs)




                                                                          No BKA
                                            DBT3 Q3: “Customer Distribution Query”
                                                                                     BKA
                      50



                                                                                     Execution time
                                                                             9.63
                                                                                     with BKA + MRR
                       5
                            0   8   16     24       32       40   48   56   64

                                         Join Buffer Size (MB)

                                                           12
MySQL 5.6.5 – Optimizer
 Postpone materialization of views/subqueries in FROM


Late materialization
 • Allows fast EXPLAINs for views/subqueries
 • Avoid materialization when possible, faster bail out
A key can be generated for derived tables
=> 240X better execution time (drops from ~8 min to ~2 sec)




EXPLAIN SELECT * FROM (SELECT * FROM a_big_table);
SELECT … FROM derived_table AS dt
         join table AS t WHERE dt.fld = t.dlf




                                  13
MySQL 5.6.5 – Optimizer
      Add EXPLAIN for INSERT/UPDATE/DELETE
  • Long standing feature request from customers and users
      CREATE TABLE t1(c1 INT, c2 INT, KEY(c2), KEY(c2, c1));

      EXPLAIN UPDATE t1 SET c1 = 10 WHERE c2 = 1;




mysql> EXPLAIN UPDATE t1 SET c1 = 10 WHERE c2 = 1;
+----+-------------+-------+-------+---------------+------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra          |
+----+-------------+-------+-------+---------------+------+---------+------+------+-------------+
| 1 | SIMPLE       | t1    | range | c2,c2_2       | c2   | 5       | NULL | 1    | Using where |
+----+-------------+-------+-------+---------------+------+---------+------+------+-------------+
1 row in set (0.00 sec)




                                                14
MySQL 5.6.5 – Optimizer Traces
SET SESSION.OPTIMIZER_TRACE=‘enabled=on’;           "records_estimation": [
SELECT (SELECT 1 FROM t6 WHERE d = c)                 {
AS RESULT FROM t5;                                      "database": "test",
select * from information_schema.OPTIMIZER_TRACE;       "table": "t6",
                                                        "range_analysis": {
                                                           "table_scan": {
                                                             "records": 2,
                                                             "cost": 4.5034
                                                        },
                                                        "potential_range_indices": [
                                                           {
                                                             "index": "d",
• EXPLAIN shows the generated plan                           "usable": true,
• TRACE shows how the plan was generated,                    "key_parts": [
                                                               "d"
  decision points etc.                                       ]
• Developers, support, advanced customers                  }
                                                        ],
• First step in 5.6.3, more tracing to come             "best_covering_index_scan": {
                                                           "index": "d",
                                                           "cost": 1.4233,
                                                           "chosen": true
                                                        },




                                         15
MySQL 5.6.5 – Performance Schema Instrumentation
 Improved Database Profiling/Application Tuning

• Statements/Stages
 • 那些查詢最耗資源 ? 它們的時間都花在那裡 ?
• Table/Index I/O, Table Locks
 • 那些應用系統的表/索引造成最多的負荷或衝突 ?
• Users/Hosts/Accounts
 • 那些應用系統的使用者,主機,帳戶花最多的資源 ?
• Network I/O
 • 網路的負荷如何 ? 各連線閑置的時間為何 ?
• Summaries
 • 依線程,使用者,帳戶或物件總合統計




                               16
MySQL 5.6.5 – InnoDB 的改善
• 更好的效能,擴展力
•   Improved performance on multi-core/CPU servers
•   Improved thread scheduling
•   Reduced contention during file extension
•   Deadlock detection now non-recursive
•   Improve LRU flushing
•   Increase max redo log size
•   Separate tablespaces for undo log
•   Fast checksum
• 更好的叵復能力
• Dump and restore buffer pool
• 更好的工具
• Full-text Search
• Variable page sizes – 4k, 8k
• Larger limit of index key prefixes (3072 bytes)




                                 17
MySQL 5.6.5 – 複製的改善
•     高可用及固障移轉
    • Global Transaction Ids
    • Replication Administration and Fail-over Utilities
• 更好的 Data Integrity
      • Crash-Safe Slaves, Replication Checksums, Crash-Safe Binlog
• 更好的效能,擴展力
      • Multi-threaded slaves
      • Reduced Binlog size for RBR
• 更多的彈性
      • Time-delayed replication
• 更容易做 troubleshooting
      • Row-based repl. logging of original query
• 強化監看/管理




                                      18
MySQL 5.6.5 複製




     =

                 19
MySQL 5.6.5 - Global Transaction Ids
• 是可靠的,自動固障移轉和回復的基礎
  • Unique identifier for each replication event written to the Binlog
• 簡易的追踪和比對跨叢集間的複製
• 自動辨識最新的 slave 作固障移轉
• 佈署複雜的複製架構
• 移除開發/操作的負荷



                 Master

                                  GTID=123456



                  GTID=123456


                                  GTID=123456 GTID=123456


                                      20
MySQL Utilities
• 將開發 / 操作常見的工作自動化
 •   複製 : 開通 , 測試 , 監控和固障移轉
 •   資料庫比對 : 一致性檢查
 •   資料庫管理 : 使用者 , 連線 , 表 , 等
 •   用於開發的新工具 , 例如 log 分析
• 以 Python scripts 開發 , 在 MySQL Workbench 下執行
 • Extensible to include custom scripting
• 資源 : Documentation & Community Forum
 • http://dev.mysql.com/doc/workbench/en/mysql-utils-man.html
 • http://forums.mysql.com/list.php?155




                                    21
Utility Workflow for Replication

                                            Fail-Over
Check           Repl          Show           & Admin




•   Check: 確認複製的先決條件
•   Repl: 開始複製到新的 Slave server
•   Show: 顯示複製的架構
•   Fail-Over & Admin: 偵測及 Master server 固障移轉 ( 或切
    換 ) 到 Slave server. 狀況監看




                         22
Fail-
 複製固障移轉工具                                         Over


                  • 自動固障移轉和 Slave server 升級
                   • 持續監看和回報健康狀況
                  • 預設是將 GTID 狀況更新到最新的
                    Slave server 升級
Master             • Slave server 升級的政策是完全可以設定的


                   Auto-Failover &     Failover
                   Slave Promotion     Utility
                   Monitoring
                  • 決不會錯失複製事件
                   • 被挑出的 Slave server 自動從後一個 Slave
                     server 取得更新




         Slaves


                    23
複製管理工具                                   Admin

                  • 進行切換以消除計劃中的維護之停機
                    時間
                  • 開啟和停止從 Slave Server

Master              Status &          Administration
                   Switchover         Utility




                  • Slave server 的回復和監看
                   • 從服務器的狀況,線程的狀況
                   • 複製處理,包括是否有任何時間差
                   • 設定從服務器升級政策




         Slaves


                   24
MySQL 5.6.5 – 其他方面的改善

•   TIME/TIMESTAMP/DATETIME – 小於一秒的精準度
•   Ipv6 improvements
•   Support Unicode for Windows command client
•   Import/export tables to/from partitioned tables
•   Explicit partition selection
•   GIS/MyISAM: Precise spatial operations




          Get it now!
          dev.mysql.com/downloads/mysql/


                            25
MySQL Database - Under Development
 Early Access Features

• 複製
  • Binlog Group Commit
  • Binlog API
• InnoDB
  • Memcached API 取用 InnoDB 的資料
  • 線上作業 (INDEX add, FK drop, Column rename)
  • SSD/Flash 最佳化
• 還有更多 ...



                  Try it now!
                  labs.mysql.com
                 labs.mysql.com/

                          26
MySQL Database – Key-value access for InnoDB
       NotOnlySQL: Memcached API
                                              • 快速,簡單取用 InnoDB
                 Application                   • 透過 Memcached API 取用
    SQL
                                               • 使用現有 Memcached clients
                                 NoSQL
(MySQL Client)                   (Memcached    • 繞過 SQL 的轉換
                                  Protocol)   • NotOnlySQL 取用
  mysqld                                       • 對 key-value 的操作
          MySQL Server   Memcached plugin      • SQL 用於複雜的查詢 , JOINs, FKs,
                                                 etc.
           InnoDB Storage Engine              • 實施
                                               • Memcached daemon plug-in 到
                                                 mysqld
                                               • Memcached 協定對映到自生的
        Try it now!                              InnoDB API
                                               • 共用處理空間使延遲非常低
        labs.mysql.com

                                              27
28




                <Insert Picture Here>




         Discussion.


     CONFIDENTIAL – ORACLE HIGHLY RESTRICTED

More Related Content

PDF
MySQL 5.5&5.6 new features summary
PDF
My sql cluster_taipei_event
PDF
MySQL 开发
PDF
Amazon Aurora로 안전하게 migration 하기
PDF
MySQL 5.6 config 優化
PDF
Percona XtraDB Cluster ( Ensure high Availability )
PPTX
Introduction to XtraDB Cluster
PDF
Introduction to MariaDB MaxScale
MySQL 5.5&5.6 new features summary
My sql cluster_taipei_event
MySQL 开发
Amazon Aurora로 안전하게 migration 하기
MySQL 5.6 config 優化
Percona XtraDB Cluster ( Ensure high Availability )
Introduction to XtraDB Cluster
Introduction to MariaDB MaxScale

What's hot (20)

PDF
Introduction to ClustrixDB
PDF
Maxscale_메뉴얼
PDF
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
PDF
제3회난공불락 오픈소스 인프라세미나 - MySQL
PDF
Galera cluster for high availability
PDF
MySQL Advanced Administrator 2021 - 네오클로바
PDF
Introduction to Galera
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
PDF
Multi thread slave_performance_on_opc
PPTX
Percona XtraDB Cluster SF Meetup
PDF
MariaDB 5.5 and what comes next - Percona Live NYC 2012
PDF
What is new in PostgreSQL 14?
PDF
Galera cluster for MySQL - Introduction Slides
PPTX
MariaDB Galera Cluster
KEY
Perf Tuning Short
PPTX
Maria DB Galera Cluster for High Availability
PDF
MySQL Performance Tuning Variables
PDF
MaxScale for Effective MySQL Meetup NYC - 14.01.21
PDF
3 周彦偉-隨需而變 我所經歷的my sql架構變遷﹣周彥偉﹣acmug@2015.12台北
DOCX
Master master vs master-slave database
Introduction to ClustrixDB
Maxscale_메뉴얼
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
제3회난공불락 오픈소스 인프라세미나 - MySQL
Galera cluster for high availability
MySQL Advanced Administrator 2021 - 네오클로바
Introduction to Galera
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
Multi thread slave_performance_on_opc
Percona XtraDB Cluster SF Meetup
MariaDB 5.5 and what comes next - Percona Live NYC 2012
What is new in PostgreSQL 14?
Galera cluster for MySQL - Introduction Slides
MariaDB Galera Cluster
Perf Tuning Short
Maria DB Galera Cluster for High Availability
MySQL Performance Tuning Variables
MaxScale for Effective MySQL Meetup NYC - 14.01.21
3 周彦偉-隨需而變 我所經歷的my sql架構變遷﹣周彥偉﹣acmug@2015.12台北
Master master vs master-slave database
Ad

Viewers also liked (8)

PPTX
MUM | Master Data Management Corporate Presentation 2010
PPTX
Community video
PPSX
Grassroots comics as alternative media
PPTX
Community television
PPTX
Media Education in India
PPTX
Multimedia production
PPTX
Who is community in community media
PDF
Innovations in Community Radio
MUM | Master Data Management Corporate Presentation 2010
Community video
Grassroots comics as alternative media
Community television
Media Education in India
Multimedia production
Who is community in community media
Innovations in Community Radio
Ad

Similar to My sql 56_roadmap_april2012_zht2 (20)

PDF
2012.10.20 OSC 2012 Hiroshima
PDF
What's new in my sql smug
PDF
MySQL update SCaLE 2012
PDF
Seminar : &quot;The Future of MYSQL - Roadmap to Success&quot; session MySQL...
PDF
Posscon my sql56
PDF
My sql 56_roadmap_april2012
PDF
20111121 osi keynote
PDF
The Dolphins Leap Again
PDF
Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
PDF
Getting ready for the new MySQL
PPT
MySQL Strategy&Roadmap
PPT
My sqlstrategyroadmap
PDF
MySQL - powering the web economy v1.0
PDF
Recent my sql_performance Test detail
ODP
MySQL Scaling Presentation
PDF
What's New in MySQL 5.6
PDF
MySQL State of the Dolphin - Rich Mason
PDF
MySQL 5.7: What's New, Nov. 2015
PPT
Megha_Osi my sql productroadmap
PDF
What's New in MySQL 5.7
2012.10.20 OSC 2012 Hiroshima
What's new in my sql smug
MySQL update SCaLE 2012
Seminar : &quot;The Future of MYSQL - Roadmap to Success&quot; session MySQL...
Posscon my sql56
My sql 56_roadmap_april2012
20111121 osi keynote
The Dolphins Leap Again
Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
Getting ready for the new MySQL
MySQL Strategy&Roadmap
My sqlstrategyroadmap
MySQL - powering the web economy v1.0
Recent my sql_performance Test detail
MySQL Scaling Presentation
What's New in MySQL 5.6
MySQL State of the Dolphin - Rich Mason
MySQL 5.7: What's New, Nov. 2015
Megha_Osi my sql productroadmap
What's New in MySQL 5.7

More from Ivan Tu (11)

PDF
8 彭立勳-double binlog方案
PDF
7 吕智超-ssd101
PDF
5 古雷my sql源碼與資料庫規範
PDF
4 葉金榮-my sql優化 - 20151219
PDF
2 ivan ma-mysql複製的演進和應用-twn- v1
PDF
1 my sql20151219-kaji_ivan
PDF
My sql fabric webinar tw2
PDF
My sql overview 2012 04-25 by scott chen - 30min - tw-1
PDF
My sql resources_april2012_zht
PDF
My sql introduction for Bestcom
PDF
My S Q L Introduction for 1 day training
8 彭立勳-double binlog方案
7 吕智超-ssd101
5 古雷my sql源碼與資料庫規範
4 葉金榮-my sql優化 - 20151219
2 ivan ma-mysql複製的演進和應用-twn- v1
1 my sql20151219-kaji_ivan
My sql fabric webinar tw2
My sql overview 2012 04-25 by scott chen - 30min - tw-1
My sql resources_april2012_zht
My sql introduction for Bestcom
My S Q L Introduction for 1 day training

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
Teaching material agriculture food technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
cuic standard and advanced reporting.pdf
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
KodekX | Application Modernization Development
Mobile App Security Testing_ A Comprehensive Guide.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Big Data Technologies - Introduction.pptx
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Teaching material agriculture food technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
cuic standard and advanced reporting.pdf
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Unlocking AI with Model Context Protocol (MCP)
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
KodekX | Application Modernization Development

My sql 56_roadmap_april2012_zht2

  • 1. 1 <Insert Picture Here> The MySQL Roadmap: Discover What’s New April, 2012 杜修文 Ivan.Tu@Oracle.Com, Oracle MySQL Sales Consultant CONFIDENTIAL – ORACLE HIGHLY RESTRICTED
  • 3. Oracle 對 MySQL 的投資 加速創新 使 MySQL 成為更好的 MySQL • #1 Open Source Database for Web Applications • “M” in most complete LAMP stack • Embedded 開發 , 推廣和支持 MySQL • Improved engineering, consulting and support • Leverage 24x7, World-Class Oracle Support MySQL 社群版 • Source and binary releases • GPL license 3
  • 4. 比以前推出更多的產品 帶動 MySQL • MySQL Enterprise Backup 3.7 • Oracle VM Template for 創新 MySQL Enterprise Edition • MySQL Enterprise Oracle Certifications • MySQL Cluster 7.2 • MySQL Enterprise Monitor • MySQL Windows Installer • MySQL Cluster 2.2 • New MySQL Enterprise Manager 1.4 • MySQL Cluster 7.1 Commercial Extensions • MySQL Utilities • MySQL Cluster Manager 1.0 1.0.6 • MySQL Workbench 5.2 All GA! All GA! • MySQL Database 5.5 • MySQL Enterprise Backup 3.5 • MySQL Database 5.6 DMR* • MySQL Database • MySQL Enterprise Monitor • MySQL Cluster 7.2 DMR 5.6.5 DMR* 2.3 and MySQL Labs! and MySQL Labs! • MySQL Cluster Manager 1.1 (“early and often”) (“early and often”) All GA! A Better MySQL *Development Milestone Release CY2010 4 CY2011 Q1 CY2012
  • 5. MySQL 5.5 – Best Release Ever InnoDB 是預設的 storage engine • ACID Transactions, FKs, Crash Recovery 效能的改善 • Enhancements in MySQL DB • Enhancements in InnoDB • + 360% over 5.1 on Linux • + 1500% over 5.1 on Windows 可用率的改善 • Semi-synchronous Replication • Replication Heartbeat 便利性的改善 • SIGNAL/RESIGNAL • More Partitioning Options • New PERFORMANCE_SCHEMA 5
  • 6. MySQL 5.5 Scales On Multi-Core SysBench Read Write MySQL 5.5.4 Transactions/Second MySQL 5.5.3 MySQL 5.1 AMD Opteron 7160 (Magny-Cours) @2100 MHz 64 GB memory 2 x Intel X25E SSD drives OS is Oracle Enterprise Linux with the Enterprise Kernel 6 4 sockets with a total of 48 cores.
  • 7. MySQL “Early Access” 發佈模式 Database and Cluster Model: Development Milestone Releases (“DMR”) • 每 3-6 個用一版新的 DMR • 每一版 DMR 累積一些新功能到下一個正式版 (5.6) • 新功能整合到穩定 lunchpad 主版 • 所有的功能由 QA 一起測試和簽發 • 接近正式版的品質 • 再一個 DMR 後收進的功能就是正式版 Model: MySQL Labs 的“早期使用”功能 • 預覽 , 不在 lunchpage 主版 (trunk) • 不保證出現在正式版 7
  • 8. MySQL Database 5.6: 一個更好的 MySQL. • MySQL 5.6 在 MySQL 5.5 上再加以改進 : • Performance and Scalability • Optimizer for better query execution times, diagnostics • Performance Schema for better instrumentation • InnoDB for better transactional throughput • Replication for higher availability, data integrity • “NotOnlySQL” options for better flexibility • 5.6.5 DMR – April, 2012 dev.mysql.com/downloads/mysql/ 8
  • 9. MySQL 5.6.5 – 優化器的改進 • Subquery Optimizations • File sort optimizations with small limit • 3X better execution time – 40s to 10s • Index Condition Pushdown • Better execution time – 15s to 90ms • Batched Key Access and Multi Range Read • Better execution time – 2000s to 10s • Postpone Materialization of views/subqueries in FROM • 240X better execution time for EXPLAIN - 8m to 2s 9
  • 10. MySQL 5.6.5 – 優化器的改善 Better Diagnostics and Debugging • EXPLAIN • INSERT, UPDATE, and DELETE • JSON format for better readability • Persistent Optimizer Statistics - InnoDB • Optimizer Traces 10
  • 11. MySQL 5.6.5 – 優化器的改善 Index Condition Pushdown (ICP) CREATE TABLE person ( personid INTEGER PRIMARY KEY, firstname CHAR(20), lastname CHAR(20), pe test postalcode INTEGER, r age INTEGER, address CHAR(50), KEY k1 (postalcode,age) ) ENGINE=InnoDB; SELECT lastname, firstname FROM person WHERE postalcode BETWEEN 5000 AND 5500 AND age BETWEEN 21 AND 22; • With ICP Disabled • With ICP Enabled • 15 s (buffer pool 128 Mb) ⇒ Execution time drops to 90 ms for both • 1.4 s (buffer pool 1.5 Gb) 11
  • 12. MySQL 5.6.5 – 優化器的改善 Batched Key Access (BKA) 和 Multi Range Read Improves performance of disk-bound join queries 5000 2821 Execution time without BKA + MRR 1225 500 Query Time (secs) No BKA DBT3 Q3: “Customer Distribution Query” BKA 50 Execution time 9.63 with BKA + MRR 5 0 8 16 24 32 40 48 56 64 Join Buffer Size (MB) 12
  • 13. MySQL 5.6.5 – Optimizer Postpone materialization of views/subqueries in FROM Late materialization • Allows fast EXPLAINs for views/subqueries • Avoid materialization when possible, faster bail out A key can be generated for derived tables => 240X better execution time (drops from ~8 min to ~2 sec) EXPLAIN SELECT * FROM (SELECT * FROM a_big_table); SELECT … FROM derived_table AS dt join table AS t WHERE dt.fld = t.dlf 13
  • 14. MySQL 5.6.5 – Optimizer Add EXPLAIN for INSERT/UPDATE/DELETE • Long standing feature request from customers and users CREATE TABLE t1(c1 INT, c2 INT, KEY(c2), KEY(c2, c1)); EXPLAIN UPDATE t1 SET c1 = 10 WHERE c2 = 1; mysql> EXPLAIN UPDATE t1 SET c1 = 10 WHERE c2 = 1; +----+-------------+-------+-------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+-------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | t1 | range | c2,c2_2 | c2 | 5 | NULL | 1 | Using where | +----+-------------+-------+-------+---------------+------+---------+------+------+-------------+ 1 row in set (0.00 sec) 14
  • 15. MySQL 5.6.5 – Optimizer Traces SET SESSION.OPTIMIZER_TRACE=‘enabled=on’; "records_estimation": [ SELECT (SELECT 1 FROM t6 WHERE d = c) { AS RESULT FROM t5; "database": "test", select * from information_schema.OPTIMIZER_TRACE; "table": "t6", "range_analysis": { "table_scan": { "records": 2, "cost": 4.5034 }, "potential_range_indices": [ { "index": "d", • EXPLAIN shows the generated plan "usable": true, • TRACE shows how the plan was generated, "key_parts": [ "d" decision points etc. ] • Developers, support, advanced customers } ], • First step in 5.6.3, more tracing to come "best_covering_index_scan": { "index": "d", "cost": 1.4233, "chosen": true }, 15
  • 16. MySQL 5.6.5 – Performance Schema Instrumentation Improved Database Profiling/Application Tuning • Statements/Stages • 那些查詢最耗資源 ? 它們的時間都花在那裡 ? • Table/Index I/O, Table Locks • 那些應用系統的表/索引造成最多的負荷或衝突 ? • Users/Hosts/Accounts • 那些應用系統的使用者,主機,帳戶花最多的資源 ? • Network I/O • 網路的負荷如何 ? 各連線閑置的時間為何 ? • Summaries • 依線程,使用者,帳戶或物件總合統計 16
  • 17. MySQL 5.6.5 – InnoDB 的改善 • 更好的效能,擴展力 • Improved performance on multi-core/CPU servers • Improved thread scheduling • Reduced contention during file extension • Deadlock detection now non-recursive • Improve LRU flushing • Increase max redo log size • Separate tablespaces for undo log • Fast checksum • 更好的叵復能力 • Dump and restore buffer pool • 更好的工具 • Full-text Search • Variable page sizes – 4k, 8k • Larger limit of index key prefixes (3072 bytes) 17
  • 18. MySQL 5.6.5 – 複製的改善 • 高可用及固障移轉 • Global Transaction Ids • Replication Administration and Fail-over Utilities • 更好的 Data Integrity • Crash-Safe Slaves, Replication Checksums, Crash-Safe Binlog • 更好的效能,擴展力 • Multi-threaded slaves • Reduced Binlog size for RBR • 更多的彈性 • Time-delayed replication • 更容易做 troubleshooting • Row-based repl. logging of original query • 強化監看/管理 18
  • 20. MySQL 5.6.5 - Global Transaction Ids • 是可靠的,自動固障移轉和回復的基礎 • Unique identifier for each replication event written to the Binlog • 簡易的追踪和比對跨叢集間的複製 • 自動辨識最新的 slave 作固障移轉 • 佈署複雜的複製架構 • 移除開發/操作的負荷 Master GTID=123456 GTID=123456 GTID=123456 GTID=123456 20
  • 21. MySQL Utilities • 將開發 / 操作常見的工作自動化 • 複製 : 開通 , 測試 , 監控和固障移轉 • 資料庫比對 : 一致性檢查 • 資料庫管理 : 使用者 , 連線 , 表 , 等 • 用於開發的新工具 , 例如 log 分析 • 以 Python scripts 開發 , 在 MySQL Workbench 下執行 • Extensible to include custom scripting • 資源 : Documentation & Community Forum • http://dev.mysql.com/doc/workbench/en/mysql-utils-man.html • http://forums.mysql.com/list.php?155 21
  • 22. Utility Workflow for Replication Fail-Over Check Repl Show & Admin • Check: 確認複製的先決條件 • Repl: 開始複製到新的 Slave server • Show: 顯示複製的架構 • Fail-Over & Admin: 偵測及 Master server 固障移轉 ( 或切 換 ) 到 Slave server. 狀況監看 22
  • 23. Fail- 複製固障移轉工具 Over • 自動固障移轉和 Slave server 升級 • 持續監看和回報健康狀況 • 預設是將 GTID 狀況更新到最新的 Slave server 升級 Master • Slave server 升級的政策是完全可以設定的 Auto-Failover & Failover Slave Promotion Utility Monitoring • 決不會錯失複製事件 • 被挑出的 Slave server 自動從後一個 Slave server 取得更新 Slaves 23
  • 24. 複製管理工具 Admin • 進行切換以消除計劃中的維護之停機 時間 • 開啟和停止從 Slave Server Master Status & Administration Switchover Utility • Slave server 的回復和監看 • 從服務器的狀況,線程的狀況 • 複製處理,包括是否有任何時間差 • 設定從服務器升級政策 Slaves 24
  • 25. MySQL 5.6.5 – 其他方面的改善 • TIME/TIMESTAMP/DATETIME – 小於一秒的精準度 • Ipv6 improvements • Support Unicode for Windows command client • Import/export tables to/from partitioned tables • Explicit partition selection • GIS/MyISAM: Precise spatial operations Get it now! dev.mysql.com/downloads/mysql/ 25
  • 26. MySQL Database - Under Development Early Access Features • 複製 • Binlog Group Commit • Binlog API • InnoDB • Memcached API 取用 InnoDB 的資料 • 線上作業 (INDEX add, FK drop, Column rename) • SSD/Flash 最佳化 • 還有更多 ... Try it now! labs.mysql.com labs.mysql.com/ 26
  • 27. MySQL Database – Key-value access for InnoDB NotOnlySQL: Memcached API • 快速,簡單取用 InnoDB Application • 透過 Memcached API 取用 SQL • 使用現有 Memcached clients NoSQL (MySQL Client) (Memcached • 繞過 SQL 的轉換 Protocol) • NotOnlySQL 取用 mysqld • 對 key-value 的操作 MySQL Server Memcached plugin • SQL 用於複雜的查詢 , JOINs, FKs, etc. InnoDB Storage Engine • 實施 • Memcached daemon plug-in 到 mysqld • Memcached 協定對映到自生的 Try it now! InnoDB API • 共用處理空間使延遲非常低 labs.mysql.com 27
  • 28. 28 <Insert Picture Here> Discussion. CONFIDENTIAL – ORACLE HIGHLY RESTRICTED