Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
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.
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
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