Contenu connexe
Similaire à What's new in my sql smug
Similaire à What's new in my sql smug (20)
Plus de Ted Wennmark (10)
What's new in my sql smug
- 1. MySQL 5.6 RC and
MySQL Cluster 7.3 DM
What's New!
Ted Wennmark
MySQL User Group
21th November 2012
- 2. Safe Harbour Statement
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.
2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 3. Program Agenda
MySQL 5.6 Release Candidate
MySQL Cluster 7.3 Labs Release
3 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 4. MySQL 5.6 Release Candidate New!
MySQL 5.6 builds on MySQL 5.5 by improving:
- InnoDB for better transactional throughput, availability
- Optimizer for better query execution times, diagnostics
- Replication for higher availability, data integrity
- Performance Schema for better instrumentation
- Other Important Enhancements
Available Now! Get it here:
dev.mysql.com/downloads/mysql/
4 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 5. InnoDB
5 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 6. MySQL 5.6: InnoDB
Better Performance, Scalability
Several internal improvements (e.g. Split kernel mutex)
Optimized for Read Only workloads
SSD Optimizations
− 4, 8k page sizes
− .ibd files outside of MySQL data dir
− separate tablespaces for undo log
6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 7. MySQL 5.6: InnoDB
Better Performance, Scalability
Optimized for Read Only workloads
− Highly concurrent, read intensive web apps
− Enables developer control of read only transactional overhead
SET autocommit = 1;
SELECT c FROM sbtest WHERE id=N; On by default
SET autocommit = 0;
START TRANSACTION READ ONLY;
Developer controlled
SELECT c FROM sbtest WHERE id=N;
COMMIT;
7 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 8. MySQL 5.6 SysBench Benchmarks
MySQL 5.6.7
Oracle Linux 6
Intel(R) Xeon(R) E7540 x86_64
MySQL leveraging:
- 48 of 96 available CPU threads
- 2 GHz, 512GB RAM
8
Scales to 48 CPU Threads
Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 9. MySQL 5.6 SysBench Benchmarks
MySQL 5.6.7
Oracle Linux 6
Intel(R) Xeon(R) E7540 x86_64
MySQL leveraging:
- 48 of 96 available CPU threads
- 2 GHz, 512GB RAM
9
Scales to 48 CPU Threads
Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 10. MySQL 5.6: InnoDB
Better Availability
Online DDL Operations implemented:
- 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
10 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 11. MySQL 5.6: InnoDB
Better Availability
Dump and restore/warm buffer pool
- At shutdown or manually at any time
- Shortens warm up times after restart (from hours to minutes)
Persistent Optimizer Statistics
- Increased plan stability
- More accurate statistics
- Better user control, automatic/manual
11 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 12. MySQL 5.6: InnoDB
Full Text Search create table quotes
( id int unsigned
FULLTEXT indexes on InnoDB tables auto_increment primary
key
Keys on text-based content ,author varchar(64)
Speeds up searches for words, phrases , quote varchar(4000)
Fully transactional, fast look up , source varchar(64)
, fulltext(quote)
Natural language/Boolean modes, proximity ) engine=innodb;
search, relevance ranking
select author as “Apple" from quotes
where match(quote) against (‘apple' in natural language mode);
12 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 13. MySQL 5.6: InnoDB
More Flexibility
Transportable Tablespaces
- Enables export/import of tables between running MySQL instances
- Faster than mysqldump (via portable .ibd files)
Export: 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;
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;
13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 14. MySQL 5.6: InnoDB
More Flexibility Key-value access to InnoDB
- via Memcached API
- Use existing Memcached clients
Application - Bypasses SQL parsing
NoSQL
SQL
(Memcached
NotOnlySQL access
(MySQL Client)
Protocol) - For key-value operations
mysqld
MySQL Server Memcached plugin - SQL for rich queries, JOINs, FKs, etc.
Implemented via:
InnoDB Storage Engine
- Memcached plug-in to mysqld
- Memcached mapped to native InnoDB
- Shared process for ultra-low latency
14 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 15. Optimizer
15 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 16. MySQL 5.6: Optimizer
Subquery Optimizations
SELECT title FROM film WHERE film_id IN
(SELECT film_id FROM film_actor
GROUP BY film_id HAVING count(*) > 12);
For Developers
- No more re-writing into joins
- Table pull-out
- Semi-join
- Subquery Materialization
DBT3 Query #18 benchmark:
- Execution time drops from DAYS to seconds
16 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 17. MySQL 5.6: Optimizer
File Sort Optimizations with Small Limit
CREATE TABLE products(
productid int auto_increment PRIMARY KEY,
productname varchar(200)
);
SELECT * FROM products ORDER BY productname 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
- 4x better execution time (drops from 40s to 10s)
17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 18. MySQL 5.6: Optimizer
Index Condition Pushdown (ICP)
CREATE TABLE person (
personid INTEGER PRIMARY KEY,
firstname CHAR(20),
pe test
lastname CHAR(20),
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)
18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 19. MySQL 5.6: Optimizer
Batched Key Access (BKA) and Multi-Range Read (MRR)
Improves performance of disk-bound join queries
5000
2821
Execution time
1225 without BKA + MRR
Q u e r y T im e ( s e c s )
500
No B K A
DBT3 Q 13: “Customer Distribution Query”
BKA
50
9.63 Execution time
5
with BKA + MRR
0 8 16 24 32 40 48 56 64
J o in B u f f e r S iz e ( M B )
19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 20. "records_estimation": [
{
MySQL 5.6: Optimizer "database": "test",
"table": "t6",
Better Diagnostics "range_analysis": {
"table_scan": {
EXPLAIN "records": 2,
"cost": 4.5034
− INSERT, UPDATE, and DELETE },
"potential_range_indices": [
− Structured EXPLAIN output {
Optimizer Traces "index": "d",
"usable": true,
"key_parts": [
"d"
SET SESSION OPTIMIZER_TRACE=‘enabled=on’; ]
SELECT (SELECT 1 FROM t6 WHERE d = c) }
],
AS RESULT FROM t5; "best_covering_index_scan": {
SELECT * FROM information_schema.OPTIMIZER_TRACE; "index": "d",
"cost": 1.4233,
"chosen": true
},
20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 21. Replication
21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 22. MySQL 5.6: Replication
New! Global Transaction Ids
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
22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 23. MySQL 5.6: Replication HA Utilities (Python)
Enabling self-healing replication topologies
Automated failover & recovery
Failed - mysqlfailover Utility
Master Switchover & administration
- mysqlrpladmin Utility
Promoted Monitoring HA Utilities
Master
Delivers HA within the core MySQL
distribution
- Eliminates the need for 3rd party solutions
- Allows extensibility to support variety of
Slaves
HA mechanisms
23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 24. MySQL 5.6: Replication
Multi-Threaded Slaves
Increases slave throughput,
reducing lag
All transactions received into
slave’s relay log
Implements multiple SQL threads,
based on database
Applies events to different
databases in parallel
Great for systems which isolate
5x performance gain
application data using databases
SysBench, running across 10 x schemas
Oracle Linux 6.1, Oracle Sun Fire x4150 m2 Server
– e.g. multi-tenant
24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 25. MySQL 5.6: Replication
Binary Log Group Commit
Binary
Log Increases replication throughput by
T1 T2 increasing performance of the
Session
T3 T4 master
Commits multiple transactions as a
Group group to Binlog on disk
commit Finer grained locking; reducing lock
Master wait times
Database
25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 26. MySQL 5.6: Crash safe Slaves
Atomic Data Automatic recovery of a slave after a
CRASH! failure
Position Info
Before:
Time
− Binlog and table data are transactionally
–Transaction Data: in tables consistent
–Replication Info: in files Resumes replication without Dev/Op
intervention
Atomic Data − Automatically rolling back replication to
Position Info
last committed event
Time
MySQL 5.6 Eliminates risk of data loss or corruption
–Transaction Data: in tables
–Replication Info: in tables
26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 27. MySQL 5.6: Replication Event Checksums
Ensures replicated data is correct,
Master Slave consistent and accessible
Detects corrupt replication events before
they’re applied
– Returns an error
Protects entire replication path
# # – Memory
– Disk
– Network
– Bugs
27 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 28. Performance Schema
28 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 29. MySQL 5.6 Performance Schema
We’ve been busy!
New Instrumentation New Features
Statements/Stages Show contents of Host cache
Table and Index I/O New Summary tables
Table locks Easier configuration
Users/Hosts/Accounts - Start up defaults in my.cnf
Network I/O - Auto tune
Reduced overhead
On by default
29 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 30. MySQL 5.6 Performance Schema
Statements/Stages
- What are my most resource intensive queries? Where do they spend time?
Table/Index I/O, Table Locks
- Which application tables/indexes cause the most load or contention?
Users/Hosts/Accounts
- Which application users, hosts, accounts are consuming the most
resources?
Network I/O
- What is the network load like? How long do sessions idle?
Summaries
- Aggregated statistics grouped by thread, user, host, account or object
30 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 31. Security
31 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 32. MySQL 5.6: Security
Major overhaul of password handling
- Provide alternatives to showing passwords in plain text
- Assess/Enforce password strength policies
- Enforce new password at next login
- Stronger password hashing
32 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 33. Other Important Enhancements
33 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 34. MySQL 5.6: Other Important Enhancements
New default configuration settings
TIME/TIMESTAMP/DATETIME - fractional second precision
TIMESTAMP/DATETIME – default /auto update = CURRENT_TIMESTAMP
TIMESTAMP – now nullable by default
Improved Partitioning
- up to 8k partitions per table
- Import/export tables to/from partitioned tables
- Explicit partition selection
GIS: Precise spatial operations
and more...
Get it now!
34
dev.mysql.com/downloads/mysql/
Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 35. Program Agenda
MySQL 5.6 Release Candidate
MySQL Cluster 7.3 Labs Release
35 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 36. MySQL Cluster 7.2 70x Faster JOINs
8x Higher Per Node Performance
Fastest Ramp…Ever
NoSQL Memcached API
Geo-Distributed Clusters
writes
36 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 37. 37 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 38. DMR1
38 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 39. EA
39 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 40. EA
40 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 41. MySQL Cluster 7.3 DMR1: Foreign Keys
Brings MySQL Cluster to a broader range of workloads
– Packaged apps, custom projects
Adds powerful functionality while reducing complexity
– App logic & data model
Enabled by default
Enforced for SQL
& NoSQL APIs
On-line add and drop
41 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 42. MySQL Cluster 7.3 DMR1: Foreign Keys
Implementation goal: compatibility with InnoDB
– Easy migration of solutions already working with InnoDB
Foreign keys are natively implemented in the storage
engine
Created in SQL
Enforced in SQL & NoSQL (C++, ClusterJ, memcached,
node.js)
http://www.clusterdb.com/mysql-cluster/foreign-keys-in-
mysql-cluster/
42 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 43. MySQL Cluster 7.3 EA: Node.js NoSQL API
Native JavaScript access to MySQL Cluster
– End-to-End JavaScript: browser to the app and
Clients database
– Storing and retrieving JavaScript objects directly
in MySQL Cluster
– Eliminate SQL transformation
V8 JavaScript Engine Implemented as a module for node.js
MySQL Cluster Node.js Module – Integrates full Cluster API library within the web
app
Couple high performance, distributed apps, with
high performance distributed database
MySQL Cluster Data Nodes
43 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 44. Try Node.js example for yourself
https://github.com/mysql/mysql-js/tree/master/samples
44 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 45. NoSQL Access to MySQL Cluster data
Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps
JPA
ClusterJPA
Apache Memcached
PHP PERL Python Ruby JDBC ClusterJ JSON
Node.js mod-ndb ndb-eng
MySQL JNI
NDB API (C++)
MySQL Cluster Data Nodes
45 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 46. MySQL Cluster 7.3 EA: Auto-Installer
Fast configuration Specify Auto-
Workload Discover
Auto-discovery
Workload optimized
Repeatable best
practices
For MySQL Cluster Define
Deploy Topology
7.2 + 7.3
46 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 47. MySQL Cluster 7.3 EA: Auto-Installer
Multi-host support
Remote deployments
47 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 48. MySQL Cluster Architecture
Clients
Application Layer
Data Layer
Management
MySQL Cluster Data Nodes
48 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 49. MySQL Cluster Architecture
Clients
Application Layer
Data Layer
Management
Management
MySQL Cluster Data Nodes
49 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 50. MySQL Cluster Architecture
Clients
Application Layer
Data Layer
Management
Management
MySQL Cluster Data Nodes
50 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 51. Getting Started
Learn More
Developer Zone
dev.mysql.com
Evaluate MySQL Cluster 7.3 Auto-Install a Cluster
Download Today
dev.mysql.com/download labs.mysql.com
s/cluster/
51 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.
- 52. Graphic Section Divider
52 Copyright © 2012, Oracle and/or its affiliates. All rights reserved | 25th October 2012 | Oracle reserves the right to change the content and timing of all future releases
.