This document discusses a presentation about new features in MySQL 5.6. The presentation provides an overview of new performance features, InnoDB features, replication features, and other enhancements in MySQL 5.6. It also discusses early access features for testing on labs.mysql.com. The goal is to help attendees understand how to leverage the new MySQL 5.6 features to build high-performance, scalable, and reliable web applications.
3. Aim of this presentation
• Give an overview of new features included in the new
MySQL 5.6 development releases
• Give an overview of the new features available to the MySQL
Community for testing via labs.mysql.com
• Benefits for attendees:
– better understand how to leverage the new features of
MySQL 5.6 to build web-based applications exhibiting
high performance, scalability and uptime
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 3
4. Agenda
<Insert Picture Here>
• MySQL & MySQL Enterprise Edition
• New Features in MySQL 5.6
- New Performance Features
- New InnoDB Features
- New Replication Features
- Other Enhancements
• Early Access Features
- InnoDB / NoSQL access to MySQL / Replication
• Overview of Removed Features in MySQL 5.6
• Summary
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 4
5. <Insert Picture Here>
MySQL & MySQL
Enterprise Edition
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 5
6. The World's Most Popular Open Source Database
Web OEM / ISV’s
SaaS, Cloud Telecommunications Enterprise 2.0
MySQL is Powering the Web
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 6
7. Oracle's Strategy:
Hardware and Software Engineered Together
• Built together
• Tested together
• Managed together
• Serviced together
• Based on open standards
Benefits:
• Better Integration
• Lower cost
• Lower risk
• More reliable
MySQL Completes The Stack
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 7
8. UNMATCHED INVESTMENT InnoDB
REPLICATION
PERFORMANCE IMPROVEMENTS EMBEDDED
WINDOWS HUNDREDS OF EXPERTS
CLOUD
STRATEGIC
WORLD-CLASS SUPPORT WEB
MySQL CLUSTER
NoSQL LINUX MySQL ENTERPRISE EDITION
LARGEST MySQL ENGINEERING & SUPPORT ORGANIZATION
8
9. More Product Releases Than Ever Before
Driving MySQL • MySQL Enterprise Backup 3.6
Innovation • Oracle VM Template for MySQL
Enterprise Edition
• MySQL Enterprise Oracle
• MySQL Database 5.5 Certifications
• MySQL Enterprise Backup 3.5 • MySQL Windows Installer
• MySQL Enterprise Monitor 2.3 • New MySQL Enterprise Commercial
• MySQL Cluster Manager 1.1 Extensions
All GA!
All GA!
• MySQL Database 5.6 DMR*
●
MySQL Workbench 5.2 • MySQL Cluster 7.2 DMR
GA! and MySQL Labs!
(“early and often”)
• MySQL Enterprise Monitor 2.2
• MySQL Cluster 7.1
• MySQL Cluster Manager 1.0
All GA!
A Better MySQL
* Development Milestone Release
Q2 CY2010 Q3 CY2010 Q4 CY2010 Q1 CY2011 Q2-4 CY2011
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 9
10. MySQL Enterprise Edition
Highest levels of MySQL Scalability, Security & Uptime
MySQL Enterprise Oracle Oracle Premier
Certifications Support
MySQL Enterprise MySQL Enterprise
Scalability Monitor/Query Analyzer
MySQL Enterprise MySQL Enterprise
Security Backup
MySQL Enterprise
High Availability MySQL Workbench
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 10
11. MySQL Enterprise Edition
New Commercial Extensions
• MySQL Enterprise Security
– External Authentication for Windows and PAM
– Integrates MySQL apps with existing infrastructures
• MySQL Enterprise Scalability
– MySQL Thread Pool
– Improves sustained performance/scale as user connections grow
– 20x scale improvement in SysBench OLTP R/W benchmarks
• MySQL High Availability
– Oracle VM Template for MySQL
– Windows Clustering
• Oracle Product Certifications
– Manage MySQL with Oracle tools that are already in use
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 11
12. MySQL Enterprise Edition
MySQL Enterprise Edition
With Thread Pool
MySQL Community Server
Without Thread Pool
MySQL 5.5.16
Oracle Linux 6.1, Unbreakable Kernel 2.6.32
2 sockets, 24 cores, 2 X 12-core
Intel(R) Xeon(R) X5670 2.93GHz CPUs
20x Better Scalability with Thread Pool
72GB DDR3 RAM
2 X LSI SCSI Disk (MR9261-8i) (597GB)
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 12
13. Oracle Premier Support for MySQL
Rely on The Experts - Get Unique Benefits
• Straight from the Source
• Largest Team of MySQL Experts
• Backed by MySQL Developers Only From
• Forward Compatible Hot Fixes
Oracle
• MySQL Maintenance Releases
• MySQL Support in 29 Languages
• Direct Access to MySQL Support Engineers
• 24/7/365 "The rep that assisted me was
• Unlimited Incidents simply outstanding. He immediately
recognized the cause of my
• Knowledge Base problem and provided the
resolution." -- (July 27, 2011)
• MySQL Consultative Support mysql.com/support/quotes
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 13
14. In Few Words:
MySQL powering the Web Economy
Oracle is driving MySQL Innovation
Enterprise Tools and Support
Services on top of MySQL
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 14
15. <Insert Picture Here>
New Features
in MySQL 5.6
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 15
16. MySQL 5.6: A better MySQL
Increased Performance, Scalability and Flexibility DM
Download!
• First public release in April 11, 2011
– not ready for use in production yet
– available for the community to test, deploy and provide feedback
– Download it from dev.mysql.com/downloads/mysql
• Builds on MySQL 5.5 by improving:
– 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
Web Cloud Embedded On-Premise
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 16
17. New Performance Features
Optimizer
• File sort optimizations for queries with ORDER by clause on
non-indexed column and small LIMIT values
• Index Condition Pushdown (ICP)
• Batched Key Access (BKA) & Multi Range Read (MRR)
• Late materialization of views/subqueries in FROM clauses
• EXPLAIN for Insert, Update, and Delete
• Persistent Optimizer Statistics (InnoDB)
• Optimizer Traces
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 17
18. New Optimizer Features
File sort optimization - ORDER by on non-indexed
column & small LIMIT
CREATE TABLE t1(
f0 int auto_increment PRIMARY KEY,
f1 int,
f2 varchar(200)
);
SELECT * FROM t1 ORDER BY f2 LIMIT 100;
• Web use case: list top 100 products sorted by name
• Avoid creating intermediate sorted files
• Produce ordered result set using a single table scan
• Example above: 20 million rows, default sort buffer
→ 3x better execution time (drops from 40s to 10s)
18
19. New Optimizer Features
Index Condition Pushdown (ICP)
CREATE TABLE person (
personid INTEGER PRIMARY KEY,
firstname CHAR(20),
lastname CHAR(20),
postalcode INTEGER,
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) – 5M rows
– Commodity hardware
19
20. New Optimizer Features
Batched Key Access (BKA) & Multi Range Read (MRR)
5000
2821
Execution time
without BKA + MRR
1225
Query Time (secs)
500
No BKA
DBT3 Q3: “Customer Distribution Query”
BKA
50
9.63 Execution time
5 with BKA + MRR
0 8 16 24 32 40 48 56 64
Join Buffer Size (MB)
20
21. New Optimizer Features
Late materialization of views/subqueries in FROM
clauses
• Late materialization
– Allows fast EXPLAINs for views/subqueries
– Avoid materialization when possible, for a faster bail out if
query is abandoned or canceled
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
21
22. New Optimizer Features
EXPLAIN for Insert, Update, and 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)
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 22
23. New Optimizer Features
Persistent Optimizer Statistics (InnoDB)
• InnoDB precomputes statistics that helps the optimizer
decide which index to use in a query
• More stable and accurate Statistics
– Persistent across server restarts
– Minimizes the overhead of recalculating statistics on start
up or crash recovery
• Can be manually updated, if needed (ANALYZE table_name)
Variables Tables
● innodb_analyze_is_persistent ● mysql.innodb_table_stats
● innodb_stats_persistent_sample_pages ● mysql.innodb_index_stats
● innodb_stats_transient_sample_pages
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 23
24. New Optimizer Features
Optimizer Traces
• EXPLAIN shows the generated plan "records_estimation": [
• TRACE shows {
"database": "test",
"table": "t6",
– how the plan was generated "range_analysis": {
"table_scan": {
– decision-making steps of the optimizer "records": 2,
"cost": 4.5034
• Useful for developers, support, advanced
},
"potential_range_indices": [
{
customers & users "index": "d",
"usable": true,
• First step in 5.6.3, more tracing to come "key_parts": [
"d"
]
}
],
SET @@SESSION.OPTIMIZER_TRACE='enabled=on'; "best_covering_index_scan": {
SELECT (SELECT 1 FROM t6 WHERE d = c) "index": "d",
"cost": 1.4233,
AS RESULT FROM t5; "chosen": true
SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; },
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 24
25. New Performance Features
Performance Schema Instrumentation
• Statements/executing Stages
Statements/executing Stages
– What are my most resource intensive queries? Where do they spend
time?
• Table/Index I/O, Table Locks
Table/Index I/O, Table Locks
– Which application tables/indexes cause the most load or contention?
• Users/Hosts/Accounts Resource Consumption
Users/Hosts/Accounts Resource Consumption
– Which application users, hosts, accounts are consuming the most
resources?
• Network I/O
Network I/O
– Is it the network or my application? How long do sessions idle?
Summaries
• Summaries
– Aggregated statistics grouped by thread, user, host, account or object
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 25
26. MySQL Database
InnoDB - Transactional by Default
• Default Storage Engine for MySQL 5.5 and above
• ACID-compliant transactions, MVCC
• Row-level locking
• Two phase commit
• Efficient indexing
• Fast DDL operations
• Table compression
• Automatic crash recovery
• Referential integrity
• Online backup
• More
26
27. New InnoDB Features
• Better diagnostics
– new INFORMATION_SCHEMA tables:
• Metrics table, System tables, Buffer pool info table
• InnoDB Buffer Pool dump/restore
• Max size of REDO log files increased to 2 TB
• Separate tablespaces for UNDO logs
• Better concurrency
– Improved auto-extension for .ibd files
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 27
28. MySQL Database
Replication Enables Scalability
Application Load Balancer
• Write to one master
Writes & Reads Reads Reads • Read from many
slaves
• Easily add more
slaves as needed
• Perfect for
read/write intensive
MySQL Replication applications
28
29. New Replication Features
• Better Data Integrity
– Crash-Safe Slaves, Replication Checksums,
– Crash-Safe Binlog
• Better Performance
– Multi-threaded Slaves
– Reduced Binlog size for RBR
• Extra flexibility
– Time-delayed replication
• Simpler troubleshooting
– Row-based repl. logging of original query
• Enhanced Monitoring/Management
– Server UUID
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 29
30. MySQL 5.6 - Other Enhancements
• Ipv6 improvements
• Support Unicode for Windows command client
• Import/export tables to/from partitioned tables
• Explicit partition selection
• GIS/MyISAM: Precise spatial operations
MySQL Manual Links:
– http://dev.mysql.com/doc/refman/5.6/en/mysql-
nutshell.html
– http://dev.mysql.com/doc/refman/5.6/en/news-5-6-x.html
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 30
31. <Insert Picture Here>
Early Access Features
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 31
32. MySQL Server - Under Development
Early Access Features Labs
Download!
• InnoDB
– Full-text Search
– Smaller 4k, 8k page sizes
– “NotOnlySQL” options for accessing InnoDB data
Try them now: labs.mysql.com
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 32
33. MySQL Server – Key-value access for InnoDB
NotOnlySQL: Memcached API Labs
Download!
Application • Fast, simple access to InnoDB
• Accessed via Memcached API
SQL NoSQL
(MySQL Client) (Memcached • Use existing Memcached clients
mysqld Protocol) • Bypasses SQL transformations
MySQL Memcached
Server plugin • NotOnlySQL access
InnoDB Storage Engine • For key-value operations
• SQL for rich queries, JOINs, foreign keys,
etc.
• Implementation
• Memcached daemon plug-in to mysqld
• Memcached protocol mapped to the native
InnoDB API
Try it now: labs.mysql.com • Shared process space for ultra-low latency
33
34. MySQL Server - Under Development
Early Access Features Labs
Download!
• Replication
– Binlog API
– Binlog Group Commit
– Durable Slave Reads
– Global Transaction IDs
Try them now: labs.mysql.com
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 34
35. MySQL Server - Under Development
• Multi-core scalability, 48-64 cores
• Subquery Optimizations
• Structured EXPLAIN output
• Online operations – indexes (add, rebuild)
• SSD optimizations, support & tuning guidelines
• Metadata for InnoDB tablespaces - portability
• TIME/TIMESTAMP/DATETIME – fractional second precision
• More…
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 35
36. <Insert Picture Here>
Overview of Removed
Features in MySQL 5.6
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 36
37. Removed Features in MySQL 5.6
• --log option. Use --general_log to enable the general query log and
the --general_log_file=file_name to set the file name
• --log-slow-queries option. Use --slow_query_log to enable the slow
query log and --slow_query_log_file=file_name to set the file name
• --one-thread option. Use --thread_handling=no-threads (used for
debug)
• --skip-thread-priority option
• engine_condition_pushdown variable. Use the
"engine_condition_pushdown" flag of the variable optimizer_switch
• The have_csv, have_innodb, have_ndbcluster, and
have_partitioning variables. Use SHOW ENGINES
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 37
38. Removed Features in MySQL 5.6
• sql_big_tables system variable. Use big_tables (for temporary
tables)
• sql_low_priority_updates variable. Use low_priority_updates
• sql_max_join_size variable. Use max_join_size
• max_long_data_size variable. Use max_allowed_packet
• FLUSH MASTER and FLUSH SLAVE statements. Use RESET
MASTER and RESET SLAVE statements
• SLAVE START and SLAVE STOP statements. Use START SLAVE
and STOP SLAVE statements
• ONE_SHOT modifier for the SET statement
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 38
39. Resources
mysql.com dev.mysql.com eDelivery.com
• TCO calculator • Community Downloads • Oracle Software Delivery Cloud
• White Papers • Documentation • Download and evaluate all
• Customer use cases and success • Dev Articles MySQL products
stories • Forums
• PlanetMySQL
MySQL Support: http://mysql.com/support/
39
41. Key Takeaways
• MySQL is important to Oracle and our Customers
– Part of our Complete, Open, Integrated Strategy
• Oracle is making MySQL better today
– Major Feature, Performance, Scalability Enhancements
– 24x7, Global Support in 145 countries
More Information
www.mysql.com
LinuxCon Europe 2011 - Prague, Oct. 28, 2011 41
42. The preceding 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.
42