MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016...
Transcript of MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016...
![Page 1: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/1.jpg)
Peter Zaitsev, CEO, Percona
February 16, 2016 Percona Technical Webinars
MySQL 5.7 For Operational DBAs an Introduction
![Page 2: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/2.jpg)
www.percona.com 2
MySQL 5.7 is Great!
A lot of Worthy Changes for
Developers and DBAs
![Page 3: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/3.jpg)
www.percona.com 3
What Developers Care about?
• JSON • GIS • Full Text Search Improvements
• Better Optimizer
Things they can use
while developing applications
![Page 4: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/4.jpg)
www.percona.com 4
What DBAs Care About ?
Performance
Availability
Security
Agility
Visibility
Architecture
![Page 5: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/5.jpg)
www.percona.com 5
Today
We focus on MySQL 5.7 for Operational
DBAs
![Page 6: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/6.jpg)
www.percona.com 6
Performance Going Faster; Scaling Better
![Page 7: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/7.jpg)
www.percona.com 7
High Concurrency
*Information from Oracle OpenWorld presentation by Geir Hoydalsvik
Starts with 8 Threads What about 2-4 threads?
![Page 8: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/8.jpg)
www.percona.com 8
MySQL 5.7: Single-threaded workload
§ Multi-threaded workload looks great § Single-threaded workload shows some regression https://bugs.mysql.com/bug.php?id=68825
http://smalldatum.blogspot.co.uk/2014/10/single-thread-performance-in-mysql-575.html
![Page 9: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/9.jpg)
www.percona.com 9
Transparent Page Compression
Rely on File System “Hole Punching”
Much Simpler
File systems may have problems having “Hole” for each page
![Page 10: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/10.jpg)
www.percona.com 10
Disk usage (Linkbench data set by Sunny Bains)
10
![Page 11: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/11.jpg)
www.percona.com 11
Performance on Fast SSD (FusionIO NVMFS)
11
![Page 12: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/12.jpg)
www.percona.com 12
Results on Slower SSD (Intel 730*2, EXT4)
12
![Page 13: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/13.jpg)
www.percona.com 13
Parallel (MTS) Replication
• Can run multiple parallel workers on the slave
• Works even for one table !
![Page 14: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/14.jpg)
www.percona.com 14
Speedup (by Vitor Oliveira)
![Page 15: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/15.jpg)
www.percona.com 15
Improved Optimizer
UNION ALL Does not use TMP Table
Subqueries in FROM Clause handles same as in VIEW
Better Cost Model
Refactored Prepared Statements
Refactored Query Parser
![Page 16: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/16.jpg)
www.percona.com 16
Can Change Costs
![Page 17: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/17.jpg)
www.percona.com 17
New Hints
• Try out different plans easily
![Page 18: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/18.jpg)
www.percona.com 18
Innodb Temporary Tables
Separate Tablespace
No Redo Logging
No Change Buffering
Less Locking
Better performance than MyISAM
![Page 19: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/19.jpg)
www.percona.com 19
Internal Oracle Benchmark
• Sysbench OLTP read only
![Page 20: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/20.jpg)
www.percona.com 20
Improved Index Creation
Up to 3x faster Index Build Speed
![Page 21: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/21.jpg)
www.percona.com 21
Native Innodb Partitioning
Better performance with many partitions
Less memory usage with many partitions
![Page 22: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/22.jpg)
www.percona.com 22
Availability Stay Up, Do not lose Data, Recover Faster
![Page 23: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/23.jpg)
www.percona.com 23
Semi-Sync Replication
• Eliminate loss of “visible” data • rpl_semi_sync_master_wait_point=AFTER_SYNC • Better Semi-Sync Performance As well
![Page 24: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/24.jpg)
www.percona.com 24
Statement Timeout
Do not let run-away queries kill your server
SET GLOBAL MAX_STATEMENT_TIME=100;
Works for Read-Only Statements only
![Page 25: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/25.jpg)
www.percona.com 25
Online GTID Deployment
Enable GTID without need to shut down Master and Slaves
![Page 26: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/26.jpg)
www.percona.com 26
Improved Innodb Crash Recovery
Especially with many tables with
innodb_file_per_table
![Page 27: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/27.jpg)
www.percona.com 27
Security Keep System Secure
![Page 28: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/28.jpg)
www.percona.com 28
Secure by Default
• No anonymous user • Only root@localhost
created • With secure random
password • Password Strength
enforced
Install with
better security
by default
![Page 29: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/29.jpg)
www.percona.com 29
AES256 Encryption • SET block_encryption_mode = 'aes-256-cbc'; • SET @key_str = SHA2('My secret passphrase',512); • SET @init_vector = RANDOM_BYTES(16); • SET @crypt_str =
AES_ENCRYPT('text',@key_str,@init_vector);
![Page 30: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/30.jpg)
www.percona.com 30
Password
• Password Strength Enforcement
• Password Expiration Enforcement
• SET GLOBAL default_password_lifetime = 180; • ALTER USER 'jeffrey'@'localhost' PASSWORD
EXPIRE INTERVAL 90 DAY; • ALTER USER 'jeffrey'@'localhost' PASSWORD
EXPIRE NEVER;
![Page 31: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/31.jpg)
www.percona.com 31
LOCK/UNLOCK Accounts
• Can Lock account for whatever reason • ALTER USER locked@localhost ACCOUNT
LOCK; • Locked Users
• Logged to the error log • Locked_connects incremented
![Page 32: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/32.jpg)
www.percona.com 32
Easier to use SSL
SSL Enabled by default
Easier to configure SSL
![Page 33: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/33.jpg)
www.percona.com 33
Tablespace Encryption
• Fresh in MySQL 5.7.11 • CREATE TABLE t1 (c1 INT)
ENCRYPTION='Y'; • Only Tablespace content is encrypted at
this point
![Page 34: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/34.jpg)
www.percona.com 34
Agility Implement Changes Faster
![Page 35: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/35.jpg)
www.percona.com 35
More Online ALTER TABLE
Enlarge VARCHAR
Rename Index
![Page 36: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/36.jpg)
www.percona.com 36
Dynamic Variables
New Variables are mostly Dynamic
Old Variables are being converted
![Page 37: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/37.jpg)
www.percona.com 37
Online Buffer Pool Resize
• Chunk for Resize • innodb_buffer_pool_chunk_size
• SET GLOBAL innodb_buffer_pool_size=4*1024*1024*1024;
http://dev.mysql.com/doc/refman/5.7/en/innodb-‐buffer-‐pool-‐online-‐resize.html
![Page 38: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/38.jpg)
www.percona.com 38
Warm not Hot
![Page 39: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/39.jpg)
www.percona.com 39
Query Rewrite Plugin
• Rewrite them to nice ones
• Or make to cause and error
Have developers
running nasty
queries ?
![Page 40: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/40.jpg)
www.percona.com 40
Mysqldump -> mysqlpump
Parallel MySQLDump
Not as parallel as mydumper
![Page 41: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/41.jpg)
www.percona.com 41
Automatic Undo Space Management
• Protection from run-away undo space • Works only when dedicated undo
tablespaces are used • innodb_undo_tablespaces=4 • innodb_undo_log_truncate=ON; • innodb_max_undo_log_size=1G
![Page 42: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/42.jpg)
www.percona.com 42
Visibility Prevent Problems; Resolve them faster
![Page 43: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/43.jpg)
www.percona.com 43
Performance Schema improvements
Memory Instrumentations
Memory used (bytes)
Operation counts Type of memory
used (caches, internal buffers, etc)
Statement Instrumentations
Stored Procedures
Stored Functions Prepared
Statements Transactions
Other Instrumentation
Replication slave status
MDL lock instrumentation
User variables per thread
Server stage tracking
Track long running SQL
![Page 44: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/44.jpg)
www.percona.com 44
SYS Schema Included in MySQL 5.7
Get the memory usage per user with SYS schema:
mysql> update performance_schema.setup_instruments set enabled='YES', timed='YES' where name like 'memory/%'; Query OK, 375 rows affected (0.00 sec) Rows matched: 375 Changed: 375 Warnings: 0 mysql> select * from sys.memory_global_total\G *************************** 1. row *************************** total_allocated: 90.20 MiB 1 row in set (0.01 sec)
mysql> select * from sys.memory_by_user_by_current_bytes\G *************************** 1. row *************************** user: root current_count_used: 42 current_allocated: 361.03 KiB current_avg_alloc: 8.60 KiB current_max_alloc: 248.04 KiB total_allocated: 46.34 GiB *************************** 2. row *************************** user: background current_count_used: 0 current_allocated: 0 bytes current_avg_alloc: 0 bytes current_max_alloc: 0 bytes total_allocated: 14.72 KiB 2 rows in set (0.01 sec)
![Page 45: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/45.jpg)
www.percona.com 45
Better Integration with OS
![Page 46: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/46.jpg)
www.percona.com 46
INNODB_METRICS
![Page 47: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/47.jpg)
www.percona.com 47
INFORMATION_SCHEMA
![Page 48: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/48.jpg)
www.percona.com 48
Explain on a Running Query
mysql> show processlist\G ... Id: 8 Command: Query Time: 90 State: Sending data Info: select count(*), osm_id from points_new group by osm_id mysql> explain for connection 8\G *************************** 1. row *************************** id: 1 select_type: SIMPLE table: points_new partitions: NULL type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 11368798 filtered: 100.00 Extra: Using temporary; Using filesort
Shows query plan on connection <id> Applicable for SELECT/INSERT/DELETE/UPDATE
![Page 49: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/49.jpg)
www.percona.com 49
JSON Explain
![Page 50: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/50.jpg)
www.percona.com 50
Architecture Architect Better Applications
![Page 51: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/51.jpg)
www.percona.com 51
JSON Datatype
Build Hybrid SQL-Document based applications
Optimized Binary Internal Storage
Optimizer Support for JSON references
![Page 52: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/52.jpg)
www.percona.com 52
Multi Source Replication
Master > Slave
Masters > Slave (Multi-Source), Since 5.7
Master > Slaves
Master > Slave > Slaves
• Now 1 replication slave can have many master servers! • Important for BI/Data Science/Ad-hoc analytics
![Page 53: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/53.jpg)
www.percona.com 53
Generated Columns
Define Column as function of other columns
Can be persistent or always computed
Can be indexed (even if virtual)
total_eur DOUBLE AS (price_eur * amount),
![Page 54: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/54.jpg)
www.percona.com 54
Multiple Triggers on same event
Allows Developers to create triggers independently
CREATE TRIGGER t1_bi_1_1 BEFORE INSERT ON t1 FOR EACH ROW FOLLOWS t1_bi
![Page 55: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/55.jpg)
www.percona.com 55
Additional Information You want to know this too
![Page 56: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/56.jpg)
www.percona.com 56
Time to kill MyISAM Feature MyISAM InnoDB
Full Text Indexes yes Since MySQL 5.6
Portable tables (tablespaces) yes Since MySQL 5.6
Spatial Indexes/RTREE (GIS) yes Since MySQL 5.7
Last update for table yes Since MySQL 5.7 (http://dev.mysql.com/worklog/task/?id=6658)
Suitable for temp tables yes Since MySQL 5.7 Also complex selects uses InnoDB ondisk temp tables
Fast count(*) yes *Faster in MySQL 5.7 but does not store counter
![Page 57: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/57.jpg)
www.percona.com 57
Defaults Changes
• sql_mode • binlog_format=ROW • Innodb_file_format=barracuda • Innodb_checksum_algorithm=crc32
Number of
Important Changes
![Page 58: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/58.jpg)
www.percona.com 58
Comple list of Features ?
• There are more than 150! • Great list maintained by Morgan
Tocker • http://www.thecompletelistoffeatures.com/
![Page 59: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/59.jpg)
www.percona.com 59
Percona Server 5.7 Better way to access MySQL 5.7 Features
![Page 60: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/60.jpg)
www.percona.com 60
Percona Server 5.7
All MySQL 5.7 Community
features included
Alternatives to many “Enterprise
Only” features
100% GPL with no restrictions
RC2 Out now. GA Imminent
![Page 61: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/61.jpg)
www.percona.com 61
Even More Visibility
Low Overhead Table/User/Index access statistics
Query Response Time Analyses
Enhanced Slow Query Log
More Information Schema Tables
![Page 62: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/62.jpg)
www.percona.com 62
Query Response Time example
![Page 63: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/63.jpg)
www.percona.com 63
More Control
Utility User for DBaaS Deployment
Enforcing Storage Engine
Set Variable for Statement
![Page 64: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/64.jpg)
www.percona.com 64
Variable for Statement Example
SET STATEMENT sort_buffer_size=100000,
max_statement_time=1000 FOR SELECT name FROM name ORDER
BY name;
![Page 65: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/65.jpg)
www.percona.com 65
Enterprise Security
PAM Authentication
Plugin Audit Plugin
![Page 66: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/66.jpg)
www.percona.com 66
Better Performance
Low impact backups with Backup Locks
True Incremental Backups with Change Tracking
Scale to 10K+ connections with ThreadPool
Ongoing work Optimizing for real customer workloads
![Page 67: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/67.jpg)
www.percona.com 67
TokuDB Storage Engine
The only Mature Transactional
Storage engine alternative to Innodb
Write Optimized High Compression
Great with Slow Storage
Saves money in the Cloud
![Page 68: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/68.jpg)
www.percona.com 68
Can get a lot of compression 68
![Page 69: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/69.jpg)
www.percona.com 69 www.percona.com
Percona Live Data Performance Conference
• April 18-21 in Santa Clara, CA at the Santa Clara Convention Center
• Register with code “WebinarPL” to receive 15% off at registration
• MySQL, NoSQL, Data in the Cloud
www.perconalive.com
![Page 70: MySQL 5.7: Introduction for Operational DBAs · Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars MySQL 5.7 For Operational DBAs an Introduction](https://reader034.fdocuments.in/reader034/viewer/2022042803/5f4ea1cac1f15b4da756a9b0/html5/thumbnails/70.jpg)
www.percona.com 70 www.percona.com
Peter Zaitsev [email protected]
@PeterZaitsev bit.ly/PerconaJobs
Thank You!