my sql indo_comm
TRANSCRIPT
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1
State of the DolphinRicky SetyawanPrincipal Sales Consultant, MySQL
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.2
Agenda
Oracle’s Investment in MySQL
MySQL 5.6
Trends & Product Directions
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3
Thank You, MySQL Community
Reviews, bug reports for MySQL 5.6 DMRs and RC Strong interest and feedback during development Sharing your enthusiasm post GA
Helping to Produce the Best MySQL Releases Ever
“MySQL 5.6 is probably the version of MySQL with the biggest bundle of new features.” Giuseppe Maxia, Continuent
“This is probably the most notable and innovative release from many years, if not ever. Oracle developer teams did great work for MySQL 5.6.” Marco Tusa, Pythian
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4
The Open Road to MySQL 5.6
Optimizer:MRR, ICP, File Sort
InnoDB:Split Kernel Mutex, MT Purge
Replication:Crash-Safe, Multi-Thread Slave, Checksums
Memcached API
New P_S
Partitioning Improvements
*Development Milestone Release
RCNov 2012
DMR1*
April 2011DMR2
Oct 2011
Optimizer:BKA, New EXPLAIN, Traces
InnoDB:Dump/Restore Buffer Pool
More P_S
DMR3Dec 2011
Optimizer:Sub-Queries
InnoDB:Full Text Index, Read-Only Optimizations
Condition Handling
Fractional Seconds
DMR4April 2012
Optimizer:JSON EXPLAIN, Sub-Queries
Replication:GTIDs
TIMESTAMP & DATESTAMP
More P_S
DMR5Aug 2012
InnoDBTT, Online DDL, Memcached API
Replication:Binary Log Group Commit
Password Mgmt
More Partitioning
New Server Defaults
More Partitioning
More GTID, TT
Consistent and Predictable Releases
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5
Controversial Releases
”MySQL 5.0: Remarkably painful”
Jeremy Cole
“MySQL 5.1 release as “GA” seems to be the most controversial to date... As a Summary I think this was inevitable MySQL 5.1 will be released for commercial/marketing reasons, not because it really meets quality guidelines…On the bright side MySQL 5.1 “GA” quality was much better than MySQL 5.0 quality when it was released.” Peter Zaitsev
MySQL 5.0 & MySQL 5.1
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6
MySQL 5.5
“Version 5.5 of the MySQL database is probably is the best MySQL version ever produced, and the upcoming version 5.6 is looking strong as well.” Mårten Mickos
“If you are using MySQL today, and you need a solid path forward on it as a platform? I’d stick with what Oracle is creating.”
Brian Aker
"From an engineering standpoint, Oracle is doing the best work on MySQL that's ever been done. Oracle is doing good, formal software engineering.” Baron Schwartz
First GA Release Under Oracle Stewardship
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7
MySQL 5.6: The Best Release Ever
“MySQL 5.6 is probably the version of MySQL with the biggest bundle of new features.” Giuseppe Maxia
“I am very excited and thrilled to use the latest release of MySQL 5.6 in production. This is probably the most notable and innovative release from many years, if not ever. Oracle developer teams did great work for MySQL 5.6, so we have to give Oracle credit for that.“Marco Tusa
“MySQL 5.6 is much faster on IO-bound, read-only workloads.” Mark Callaghan
“If GTIDs and MySQL failover work as advertised, it's living the dream of no-fuss failover.”Sheeri Cabral
“MySQL vs MariaDB performance. The obvious take away is as expected, upgrade any 5.5 installations to 5.6.”Brian Aker
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8
Driving Innovation AND Quality
MySQL 5.6
MySQL 5.5
MySQL 5.1
MySQL 5.0
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9
Oracle Significantly Invests in MySQLIn a Unique Position to Deliver
EXPERTISE & RESOURCES
PROFESSIONAL ENGINEERING
INNOVATION & ROADMAP
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10
Hundreds of MySQL development engineers, support experts and consultants, including original architects of the server, InnoDB and MySQL Cluster
Investing and growing the teamBY FAR, THE LARGEST DEVELOPMENT
TEAM IN MySQL’S HISTORY
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11
A Very Busy Team: Innovation and Quality
191 Worklogs for MySQL 5.6
1667 Bugs Fixed in 5.6
2909 Bugs Fixed in Total Since MySQL 5.5 GA
911 New MTR Tests in MySQL 5.6
Tripled QA Team - 400 Man/Year Database QA Experience
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12
MySQL Code Size Over ReleasesObservations and Blog from Stewart Smith
“MySQL 5.6 is the largest MySQL code size increase in a MySQL version ever.
The last time we saw anything like this was with the merging of MySQL Cluster in 4.1. At the very least, Oracle is paying people to write lines of code to extent that nobody has before.”
Stewart Smith
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14
COMPONENTS
50 Product Categories
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15
Web, Mobile, EmbeddedOn Premise & in the Cloud
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16
MySQL Enterprise Monitor 2.2
MySQL Cluster 7.1
MySQL Cluster Manager 1.0
MySQL Workbench 5.2
MySQL Database 5.5
MySQL Enterprise Backup 3.5
MySQL Enterprise Monitor 2.3
MySQL Cluster Manager 1.1
Driving MySQL Innovation
All GA!
MySQL Enterprise Backup 3.7
Oracle VM Template for MySQL Enterprise Edition
MySQL Enterprise Oracle Certifications
MySQL Windows Installer
MySQL Enterprise Security
MySQL Enterprise Scalability
MySQL Database 5.6 DMR*
MySQL Cluster 7.2 DMR
MySQL Labs!
(“early and often”)
All GA!
MySQL Cluster 7.2
MySQL Cluster Manager 1.4
MySQL Utilities 1.2
MySQL Migration Wizard
MySQL Enterprise Backup 3.8
MySQL Enterprise Audit
MySQL Database 5.6
MySQL Cluster 7.3 DMR
*Development Milestone Release
2010 2011 2012-13
All GA!
Available Now!
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17
MySQL 5.6: Best Release Ever!
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18
MySQL 5.6: Scalability
Users can fully utilize latest generations of hardware and OS Scales as data volumes and users grow
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19
MySQL 5.5
MySQL 5.6
MySQL 5.6 SysBench Benchmarks
Up to 234% Performance Gain
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21
Several internal improvements (e.g. Split kernel mutex, efficient Buffer Pool Flushing, more...)
Optimized for Read Only workloads Persistent Optimizer Statistics
- Increased plan stability, accurate statistics- Better user control, automatic/manual
SSD Optimizations- 4, 8k page sizes- .ibd files outside of MySQL data dir- separate tablespaces for undo log
MySQL 5.6: InnoDBBetter Performance, Scalability
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.22
Ideal for highly concurrent, read intensive web apps Enables developer control of read only transactional overhead
MySQL 5.6: InnoDBOptimized for Read Only Workloads
SET autocommit = 1;
SELECT c FROM sbtest WHERE id=N;
SET autocommit = 0;
START TRANSACTION READ ONLY;
SELECT c FROM sbtest WHERE id=N;
COMMIT;
On by default
Developer controlled
Less complexity, more apps can be standardized on InnoDB
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23
CREATE INDEX DROP INDEX Change AUTO_INCREMENT value for a column ADD/DROP FOREIGN KEY Rename COLUMN Change ROW FORMAT, KEY_BLOCK_SIZE for a table Change COLUMN NULL, NOT_NULL Add, drop, reorder COLUMN
MySQL 5.6: InnoDBOnline DDL Operations
Adds flexible schemas, online changes, no downtime No need to consider NoSQL options
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.24
Shortens warm up times after restart (from hours to minutes) At shutdown/startup or manually at any time Small footprint on disk - stores tablespace and page IDs only
MySQL 5.6: InnoDBDump and Restore/Warm Buffer Pool
Dump current state of Buffer Pool at shutdown:
mysql> SET innodb_buffer_pool_dump_at_shutdown=ON;
Load Buffer Pool from dump at startup:
mysql> SET innodb_buffer_pool_load_at_startup=ON;
Better Elasticity - Quickly spin up new instances to meet demand Great for Cloud, Hosted, SaaS, On-premise deployments
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25
FULLTEXT indexes on InnoDB tables Keys on text-based content Speeds up searches for words, phrases Fully transactional, fast look upNatural language/Boolean modes, proximity search, relevance ranking
MySQL 5.6: InnoDBFull Text Search
create table quotes ( id int unsigned auto_increment primary key ,author varchar(64) , quote varchar(4000) , source varchar(64) , fulltext(quote) ) engine=innodb;
select author as “Apple" from quotes where match(quote) against (‘apple' in natural language mode);
Less complexity, more apps can be standardized on InnoDB
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26
Enables export/import of tables between running MySQL instances
MySQL 5.6: InnoDBTransportable Tablespaces
CREATE TABLE t(c1 INT) engine=InnoDB;
FLUSH TABLE t FOR EXPORT; -- quiesce the table and create the meta data file
$innodb_data_home_dir/test/t.cfg
UNLOCK TABLES;
Export:
Import:CREATE TABLE t(c1 INT) engine=InnoDB; -- if it doesn't already exist
ALTER TABLE t DISCARD TABLESPACE;
-- The user must stop all updates on the tables, prior to the IMPORT
ALTER TABLE t IMPORT TABLESPACE;
Better Elasticity - Quickly spin up new instances to meet demand Great for Cloud, Hosted, SaaS, On-premise deployments
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.27
Same app can leverage: Key-value access to InnoDB via
familiar Memcached API SQL for rich queries, JOINs,
FKs, etc. Fully transactional
MySQL 5.6: InnoDBNoSQL Key Value Access to InnoDB
Up to 9x performance boost for updates
Great for fast data ingestion in Big Data pipeline
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.29
Subquery Optimizations File sort optimizations for most web use cases
-4x better execution time – 40s to 10s Index Condition Pushdown
-160x better execution time – 15s to 90ms Batched Key Access and Multi Range Read
-280x better execution time – 2800s to 10s
MySQL 5.6: Optimizer
Better complex query execution times ever growing data sets (Big Data!) MEM + Query Analyzer key to utilizing full benefits of 5.6 Optimizer MySQL Consultative Support provides guidance on configuration
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.30
For Developers- No more re-writing legacy application or packaged subqueries into joins
Performance- DBT 3 Query #13 benchmark: - Execution time drops from DAYS to seconds
MySQL 5.6: OptimizerSubquery Optimizations
SELECT title FROM film WHERE film_id IN
(SELECT film_id FROM film_actor
GROUP BY film_id HAVING count(*) > 12);
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.31
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
MySQL 5.6: OptimizerPostpone Materialization of views/subqueries in FROM
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.32
Use sort_buffer_size to sort all in memory, avoid creating intermediate sorted files
Produce ordered result set using a single table scan Example above: 20 million rows, using default sort_buffer_size
- 4x better execution time (drops from 40s to 10s)
CREATE TABLE products( productid int auto_increment PRIMARY KEY, productname varchar(200));
SELECT * FROM products ORDER BY productname LIMIT 100;
MySQL 5.6: OptimizerFile Sort Optimizations with Small Limit
Web use case – list top 100 products sorted by name
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.33
testperCREATE 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- 15 s (buffer pool 128 Mb)- 1.4 s (buffer pool 1.5 Gb)
With ICP Enabled- Execution time drops to 90 ms for
both
MySQL 5.6: OptimizerIndex Condition Pushdown (ICP)
Controlled by optimizer_switch index_condition_pushdown flag
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.34
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)
Execution time without BKA + MRR
Execution time with BKA + MRR
DBT3 Q 13: “Customer Distribution Query”
MySQL 5.6: OptimizerBatched Key Access (BKA) and Multi-Range Read (MRR)
Controlled by optimizer_switch flags
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.35
EXPLAIN - INSERT, UPDATE, and DELETE- Structured EXPLAIN output Optimizer Traces
MySQL 5.6: OptimizerBetter Diagnostics
SET SESSION OPTIMIZER_TRACE=‘enabled=on’;
SELECT (SELECT 1 FROM t6 WHERE d = c)
AS RESULT FROM t5;
SELECT * FROM information_schema.OPTIMIZER_TRACE;
"records_estimation": [ { "database": "test", "table": "t6", "range_analysis": { "table_scan": { "records": 2, "cost": 4.5034 }, "potential_range_indices": [ { "index": "d", "usable": true, "key_parts": [ "d" ] } ], "best_covering_index_scan": { "index": "d", "cost": 1.4233, "chosen": true },
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.36
MySQL 5.6: Best Replication Features Ever
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.37
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=123456
GTID=123456 GTID=123456
MySQL 5.6: ReplicationGlobal Transaction Ids
Eliminates the need for complex 3rd party solutions
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.38
Enabling self-healing replication topologies
Automated failover & recovery- mysqlfailover Utility
Switchover & administration- mysqlrpladmin Utility
Delivers HA within the core MySQL distribution- Eliminates the need for 3rd party solutions - Allows extensibility to support variety of
HA mechanisms
HA UtilitiesMonitoring
FailedMaster
Slaves
PromotedMaster
MySQL 5.6: Replication HA Utilities (Python)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.39
MySQL 5.6: ReplicationMulti-Threaded Slaves
Increases slave throughput, reducing lag
Applies events to different databases in parallel using concurrent SQL threads
5x performance gain
Great for systems which isolate application data using databases
- Cloud, SaaS, Hosting, other multi-tenant deployments
SysBench, running across 10 x schemas Oracle Linux 6.1, Oracle Sun Fire x4150 m2 Server
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.40
Increases replication throughput by increasing performance of the master
Commits multiple transactions as a group to Binlog on disk
Finer grained locking; reducing lock wait times
Session
BinaryLog
MasterDatabase
T1 T2
T3 T4
Groupcommit
MySQL 5.6: ReplicationBinary Log Group Commit
Better transactional throughput, less slave lag when coupled with MTS MySQL Consultative Support provides guidance on configuration
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.41
Binary Log Group Commit PerformanceBinlog=1
MySQL 5.6
MySQL 5.5
180% Performance Gain
Oracle Linux 6Intel(R) Xeon(R) E7540 x86_64MySQL leveraging:- 60 of 96 available CPU threads- 2 GHz, 512GB RAM
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.42
New option: binlog-row-image=minimal Increases throughput for master and slave
- Reduces Binlog size, memory & network bandwidth Only replicates elements of the Row image that have changed
Primary Key Changed Columns
MySQL 5.6: ReplicationOptimized Row Base Replication
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.43
Before:– Transaction Data: in tables
– Replication Info: in files
MySQL 5.6– Transaction Data: in tables– Replication Info: in tables
Data
Position InfoCRASH!
Time
Data
Position InfoTime
Automatic recovery of a slave after a failure- Binlog and table data are transactionally
consistent Resumes replication without Dev/Op
intervention- Automatically rolling back replication to
last committed event
Atomic
Atomic
MySQL 5.6: Crash safe Slaves
Eliminates risk of data loss or corruption
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.44
Ensures replicated data is correct, consistent and accessible
Detects corrupt replication events before they’re applied
– Returns an error
Protects entire replication path– Memory
– Disk
– Network
– Bugs
Master
#
Slave
#
MySQL 5.6: Replication Event Checksums
Eliminates risk of data loss or corruption
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.45
MySQL 5.6: Performance SchemaNew Instrumentation Statements/Stages Table and Index I/O Table locks Users/Hosts/Accounts Network I/O
New Features
Show contents of Host cache
New Summary tables
Easier configuration
- Start up defaults in my.cnf
- Auto tune
Reduced overhead
On by default[mysqld] performance_schema=on
Provides user/session level stats on resource usage for Cloud-based consumption/reporting/charge back
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.46
Reaching Out to the Community
Grown Community team Sponsored over 40 events Delivered over 70 talks at conferences Dozens of Tech Tours, Developer Days, Workshops and User Groups
MySQL tracks at SCaLE and SELF Conferences Blogs & social media MySQL Connect
In the Past Year:
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.48
Strong demand for web & mobile apps/services accessible 24/7 from mobile devices
Organizations creating, deploying and utilizing Web apps faster and in greater numbers than ever before
Mobile Internet Booming
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.50
MySQL 5.7.1
Support for stacked diagnostic areas according to the SQL standard
Replication improvements: Non-blocking ‘SHOW SLAVE STATUS’ – useful for monitoring
tools Idempotent mode of operation for MySQL Server, where the
server will ignore errors while applying row-based events in a binlog file
Added –rewrite-db option to mysqlbinlog so an RBR log can be replayed to a different database name
Available Now! dev.mysql.com
1st DMR
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.51
MySQL 5.7.1
• Online RENAME INDEX• Online enlarge VARCHAR size• Improved InnoDB temporary table DDL performance to
get it on par with or even better than MyISAM• Introduced InnoDB table space for temporary (non-
compressed) tables • Fixed long-standing bug#6295 – “Triggers are not
processed for not null columns”
Available Now! dev.mysql.com
1st DMR1st
DMR
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.52
Foreign Key Support MySQL 5.6
Auto-Installer NoSQL Node.js / JavaScript API
2nd DMR
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.53
Oracle Premier Lifetime Support
Oracle Product Certifications/Integrations
MySQL Enterprise High Availability
MySQL Enterprise Security
MySQL Enterprise Scalability
MySQL Enterprise Backup
MySQL Enterprise Monitor/Query Analyzer
MySQL Workbench
MySQL Enterprise EditionHighest Levels of MySQL Scalability, Security and Uptime
MySQL Enterprise Audit
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.54
§ Online Backup for InnoDB (scriptable interface)
§ Full, Incremental, Partial Backups (with compression)
§ Point in Time, Full, Partial Recovery options
§ Enterprise Advisor Monitoring and Alerts on Backup Operations
§ Metadata on status, progress, history
§ Unlimited Database Size
§ Cross-Platform- Windows, Linux, Unix
§ Certified with Oracle Secure Backup, NetBackup, Tivoli, others
MEB Backup Files
MySQL Database Files
mysqlbackup
Ensures quick, online backup and recovery of your on premise and Cloud based MySQL applications.
MySQL Enterprise Backup
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.55
MySQL Enterprise Backup
MySQL Enterprise Backup: 49x Faster than mysqldump
49x More
Performance
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.56
MySQL Enterprise Backup
MySQL Enterprise Backup: 80x Faster than mysqldump
80x More
Performance
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.57
MySQL Enterprise Monitor
Real-time MySQL performance and availability monitoring
Visually find & fix problem queries
Disk monitoring for capacity planning
Cloud friendly architecture (no agents)
Start monitoring MySQL in 10 minutes
Remote agent option provides OS monitoring
New!
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.58
MySQL Query Analyzer
Real-time query performance
Visual correlation graphs
Find & fix expensive queries
Detailed query statistics
Query Response Time index (QRTi)
“With the MySQL Query Analyzer, we were able to identify and analyze problematic SQL code, and triple our database performance. More importantly, we were able to accomplish this in three days, rather than taking weeks.”
Keith Souhrada Software Development Engineer Big Fish Games
Improved
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.59
InnoDB Monitoring
Monitor key performance metrics
Stay on top of locking issues
Get configuration advice
Examine buffer pool usage
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.60
Concluding Thoughts
Oracle Invests in MySQL like Never Before
Oracle Drives MySQL Innovation
Oracle Makes MySQL Better for Next Generation Web,
Cloud and Big Data Applications
Get MySQL 5.6! http://www.mysql.com/downloads/