MySQL 5.7 milestone

Louis liu
Louis liuData Architect
www.vmcd.org
MySQL 5.7 Important Features
InnoDB Read-Only Scalability
Improving the performance for Read-Only and Read-Mostly workloads. Significantly improved how InnoDB handles RO trans-actions
Removed server layer contentions related to Meta Data Locking (MDL) and removed the use of “thread locks” (thd_locks) for InnoDB
In MySQL 5.7.2, there is another optimization where all transactions are treated as a read-only transactions by default, and a transaction is only
assigned an ID and a rollback segment when the transaction attempts to do its first update. This optimization of treating all transactions as
read-only by default has the additional benefit that users do not need to use special syntax or change their applications to take advantage of it.
Reference:
http://dimitrik.free.fr/blog/archives/09-01-2013_09-30-2013.html
http://mysqlserverteam.com/mysql-5-7-over-1m-qps-with-innodb-memcached-plugin/
http://mysqlserverteam.com/transaction-life-cycle-improvements-in-5-7-3/
http://mysqlserverteam.com/mysql-5-7-3-deep-dive-into-1mil-qps-with-innodb-memcached/
www.vmcd.org
InnoDB Read-Write Scalability.
Improved the performance of Read-Write (RW) workloads. We have removed the “index lock contention” in InnoDB. The index lock that was
used to protect the entire index tree structure is now replaced by more fine grained “block locks” in the tree.
InnoDB has two "modes" when updating the Btrees. An optimistic mode and a pessimistic mode. They roughly correspond to in-place changes
and tree modification changes. If InnoDB thinks that an insert/delete will result in a tree modification change it will lock the index in X mode.
This blocks readers too and limits concurrency. The fix was to introduce a new lock mode SX. This reduces the need to lock the entire Btree
during tree modification changes.
Reference:
https://blogs.oracle.com/mysqlinnodb/entry/innodb_5_7_performance_improvements
http://mysqlserverteam.com/mysql-5-7-improves-dml-oriented-workloads/
https://blogs.oracle.com/mysqlinnodb/entry/innodb_5_7_performance_improvements
www.vmcd.org
InnoDB Faster & Parallel Flushing
InnoDB has had some sub-optimal code around traversing the dirty page and LRU list flushing. The problem was that when we release the
buffer pool and associated mutexes during the IO phase we can no longer trust the iterator that is used to scan the aforementioned lists. So, we
restart the scan from the start. The fix was to track whether the iterator was invalidated while the covering mutexes where released. If the
iterator was not invalidated then we can carry on from where we left off. If on the other hand we detect that it was invalidated we go back to
the start and do it the old way. The iterator invalidation should be very rare.
Reducing the number of pages scanned when doing flush list batches, speeding up page flushing
Recently our benchmarks showed that we are scanning excessive number of pages when
doing flush list batches. We fixed it by introducing the concept of Hazard Pointer
which reduced the time complexity of scan from O(n*n) to O(n). This WL builds on
that to extend the same concept to other scans within buffer pool. There are
significant other changes which are made as part of reduced scanning logic.
The time complexity of a scan is reduced from O(n*n) to O(n). We have also implemented parallel flushing by having multiple page_cleaner
threads
Reference:
https://blog.mariadb.org/performance-evaluation-of-mariadb-10-1-and-mysql-5-7-4-labs-tplc/
www.vmcd.org
Speeding up Connection Handling
In 5.7 we have offloaded thread initialization and network initialization to a worker thread and more than doubled MySQL’s ability to do high
frequency connect/disconnect cycles, from 26K to 56K connect/disconnect cycles per second
Reference:
http://mysqlserverteam.com/improving-connectdisconnect-performance/
Bulk Data Load Improvements
Bulk Load for Create Index – Faster index creation
This method of index creation is also known as a “sorted index build”. This enhancement, which improves the efficiency of index creation, also
applies to full-text indexes. A new global configuration option, innodb_fill_factor, defines the percentage of space on each page that is filled
with data during a sorted index build, with the remaining space reserved for future index growth. For more information, see Section 14.13.18,
“Bulk Load for CREATE INDEX”.
www.vmcd.org
Bulk INSERT operations can be sped up by creating the secondary indexes afterwards. In this way, the records will be merge sorted and then
inserted into the InnoDB index B-trees in order, using sequentially allocated pages. This will create a more optimal layout especially for indexes
whose columns are updated rarely
Resize the InnoDB Buffer Pool Online
Change “ innodb_buffer_pool_size“ dynamically.
Reference:
http://mysqlserverteam.com/resizing-buffer-pool-online/
Automatic Truncation of UNOD Logs
Need separate UNDO tablespaces have been configured.
Reference:
http://mysqllover.com/?p=1051
www.vmcd.org
InnoDB Online Alter Table
Onine rename index and enlarge varchar column size
Online Rename Index This work by Marko Mäkelä (WL#6752) and Dmitry Lenev (WL#6555) makes it possible to rename an index as an online operation. Example:
mysql> ALTER TABLE t RENAME INDEX i1 TO i2;
Enlarge VARCHAR column size online (WL#6554) This work by Marko Mäkelä makes it possible to enlarge varchar column sizes as an online operation. This is true as
long as the number of bytes required by the VARCHAR column type (VARCHAR/LONGVARCHAR) remains the same, i.e. from 0 to 255 or from 256 to higher. Example:
mysql> ALTER TABLE t1 ALGORITHM=INPLACE, CHANGE COLUMN c1 c1 VARCHAR(255);
Setting Replication Filters Without Server Restart
Dynamically change Filter behaviors without restart server
Reference:
http://mysqlserverteam.com/mysql-5-7-3-making-mysql-slave-replication-filters-dynamic/
www.vmcd.org
CHANGE MASTER Without Stopping the SQL Thread
In order to add/alter an option using the CANGE MASTER TO command, it was previously necessary to issue a STOP SLAVE command before
the CHANGE MASTER TO command. This work relaxes that constraint.
Reference:
http://mysqlserverteam.com/mysql-5-7-4-change-master-without-stopping-slave-altogether/
http://work.shivjijha.com/2014/04/change-master-without-stopping-slave.html
Improved “IN queries” With Row Value Expressions to Be Executed Using Range Scans
As of 5.7.3 this hole in the net is stitched up. The range optimizer gladly opens the door for queries with IN predicates as long as
The predicate is only IN, not NOT IN.
The row on the predicate’s left-hand side is only indexed column references, in the same index.
The rows contain only constants or come from a previously read table in nested-loops join.
Note that ‘constants’ is a pretty broad category. It consists of pre-evaluated expressions, even some sub-queries, SQL variables and similar
beings
www.vmcd.org
Improving performance when using in predicates
Reference:
http://mysqlserverteam.com/range-access-now-in-an-in-predicate-near-you/
UNION ALL” No Longer Creates a Temporary Table
In 5.7 the optimizer avoids creating a temporary table for the result of UNION ALL queries when there is no need for it, i.e., when there is no
top-level ORDER BY clause
Reference:
http://mysqlserverteam.com/state-of-the-union/
www.vmcd.org
EXPLAIN for Running Queries
This feature is useful if you are running a statement in one session that is taking a long time to complete; using EXPLAIN FOR CONNECTION in
another session may yield useful information about the cause of the delay and thus help you optimize your schema and statements.
JSON EXPLAIN
Make Use of Condition Filtering in the Optimizer
Reference:
http://mysqlserverteam.com/a-new-dimension-to-mysql-query-optimizations-part-1/
http://mysqlserverteam.com/a-new-dimension-to-mysql-query-optimizations-part-2/
www.vmcd.org
Improved ONLY_FULL_GROUP_BY SQL Mode
ONLY_FULL_GROUP_BY SQL mode was enabled by default in 5.75+
In MySQL, one can write GROUP BY queries that reference non-aggregated columns in the SELECT list that are not included in the GROUP BY
clause, even if these columns are not functionally dependent upon the GROUP BY clause. This behaviour conforms to none of the SQL standard's
versions. It is possible to avoid this behaviour by including ONLY_FULL_GROUP_BY in the sql_mode server setting, but it might make more sense
to take advantage of the ability to write only partial GROUP BY clauses.
In a nutshell:
It is completely safe to write partial GROUP BY clauses as long as all non-aggregated columns in the SELECT list are functionally dependent upon
the GROUP BY clause.
A partial GROUP BY list can result in better performance, because it keeps the server from evaluating the entire GROUP BY list.
If one does not want to write partial GROUP BY clauses, consider using MIN or MAX to 'aggregate' the functionally dependent columns in the
SELECT list rather than moving the functionally dependent columns to the GROUP BY clause.
Reference:
http://rpbouman.blogspot.co.uk/2007/05/debunking-group-by-myths.html
http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/
www.vmcd.org
Copying File-Per-Table Tablespaces to Another Server
Prior to MySQL 5.7.4, only non-partitioned InnoDB tables are supported. As of MySQL 5.7.4, partitioned InnoDB tables and individual InnoDB
table partitions and subpartitions are also supported.
Reference:
https://dev.mysql.com/doc/refman/5.7/en/tablespace-copying.html
InnoDB Buffer Pool Dump and Load Enhancements
This work improves both the dump and load scenarios. It is now possible to dump only the hottest N% of the pages from each buffer pool. The load
operation is also made less disruptive to user activity because the load now happens in the background while continuing to serve clients
Reference:
www.vmcd.org
http://mysqlserverteam.com/mysql-dumping-and-reloading-the-innodb-buffer-pool/
http://mysqllover.com/?p=1123
Statement Timeouts
MySQL 5.7.4 introduces the ability to set server side execution time limits, specified in milliseconds, for top level read-only SELECT statements.
This feature is introduced as part of WL#6936. It is based on a contribution submitted by Davi Arnaut with Bug#68252. Thank you, Davi!
The statement timeouts work by interrupting the execution of the statement when it takes longer than a specified number of milliseconds to
complete. After the specified number of milliseconds has passed, the server aborts the individual query without affecting the larger transaction
or connection contexts. The following error is then reported to the client when the query is aborted:
1907: Query execution was interrupted, max_statement_time exceeded.
To be clear, the execution time limit specified is really a “soft hint”, because the query interruption may not happen precisely at the specified
execution time limit. There can be a minor delay between the timer expiration and the actual query interruption.
A time limit for any SELECT statement run against a MySQL instance can be set by specifying a timeout value in milliseconds for the GLOBAL
system variable max_statement_time.
www.vmcd.org
Reference:
http://planet.mysql.com/entry/?id=673840
http://mysqlserverteam.com/server-side-select-statement-timeouts/
Multiple User Level Locks
The difference in lock acquisition behavior as of MySQL 5.7.5 can be seen by the following example. Suppose that you execute these
statements:
SELECT GET_LOCK('lock1',10);
SELECT GET_LOCK('lock2',10);
SELECT RELEASE_LOCK('lock2');
SELECT RELEASE_LOCK('lock1');
In MySQL 5.7.5 or later, the second GET_LOCK() acquires a second lock and both RELEASE_LOCK() calls return 1 (success). Before MySQL 5.7.5,
the second GET_LOCK() releases the first lock ('lock1') and the secondRELEASE_LOCK() returns NULL (failure) because there is no 'lock1' to
release.
www.vmcd.org
Waiting for More Transactions to Enter Binlog Group Commit (BGC) Queues
Solve the lag problem in MySQL slave database. We could read Booking’s article for cascade M-S architecture.
binlog-group-commit-sync-delay, binlog-group-commit-sync-no-delay-count were used to control BGC.
Reference:
http://blog.booking.com/evaluating_mysql_parallel_replication_2-slave_group_commit.html
Semi-Sync Replication
Make the Master Wait for More than One Slave to Acknowledge Back
Externalize Transactions Only after ACK is Received
Semi-Sync — Separate ACKs Collector
Reference:
www.vmcd.org
http://my-replication-life.blogspot.sg/2013/12/enforced-semi-synchronous-replication.html
http://my-replication-life.blogspot.sg/2013/12/enforced-semi-synchronous-replication.html
http://my-replication-life.blogspot.sg/2014/03/faster-semisync-replication.html
Multi-Threaded Slaves (MTS)
Intra-Schema Parallel Slave Execution
Reference:
http://geek.rohitkalhans.com/2013/09/enhancedMTS-configuration.html
Ordered Commits (Sequential Consistency)
Ensure that the commits by slave applier threads running in parallel will be done in the same order as they were on the master.
www.vmcd.org
Support Slave Transaction Retries in Multi-Threaded Slave Mode
Transaction retry feature works for both types of mutli-threaded slave(database based and logical clock based). It also works fine when you
force slave to commit transactions in same order as master by setting system variable “slave_preserve_commit_order” to ON.
By default, transaction retry is on for all types of slave. Multi-threaded slave will not break if it just encounters some temporary errors
mentioned above.
TRUNCATE TABLE Statement Becomes Atomic
This work makes the internal InnoDB TRUNCATE TABLE statement atomic by reinitializing the original table-space header with the same space
id and then physically truncating its.ibd file during the truncation of a single table tablespace.
Reference:
http://mysqllover.com/?p=1053
www.vmcd.org
InnoDB Create Tablespace in 5.7
CREATE TABLESPACE `TBS_DADOS_COMPRESS` ADD DATAFILE 'TDS_DC_DATAFILE1.ibd' [FILE_BLOCK_SIZE=4];
CREATE TABLESPACE `TBS_DADOS` ADD DATAFILE 'TDS_D_DATAFILE1.ibd' [FILE_BLOCK_SIZE=8];
CREATE TABLE ITEM_VENDA TABLESPACE=`TBS_DADOS_COMPRESS`;
ALTER TABLE tbl_name TABLESPACE=`TBS_DADOS`
DROP TABLESPACE `TBS_DADOS_COMPRESS`;
Reference:
http://mathiasbrem.com.br/innodb-create-tablespace-mysql-5-7/
InnoDB Native Partitioning
Less handles less use of memory. Easy to access partition tables
Reference:
www.vmcd.org
http://mysqlserverteam.com/innodb-native-partitioning-early-access/
InnoDB Temporary Table Performance
Temporary Tables
Faster create/drop
No redo logging
Separate tablespace for all uncompressed temporary tables
Temporary tables don't require recovery therefore there is no point in saving their definitions in the persistent data dictionary. By putting the all
the temporary tables in a special tablespace that is not redo logged we can reduce a lot of the unnecessary overhead. We do UNDO log the
changes to temporary tables, this is required for rollback to savepoint. However, the UNDO logs for temporary tables are not redo logged and
the UNDO logs for temporary tables also reside in the special temporary tablespace.
Temp tables are only visible within the connection/session in which they were created, and they are bound by the lifetime of the server. We
optimized DML for Temp Tables (WL#6470) by removing unnecessary UNDO and REDO logging, change buffering, and locking. We added an
additional type of UNDO log (WL#6915), one that is not REDO logged and resides in a new separate temp tablespace.
www.vmcd.org
Multi-Source Replication
Nearly MariaDB. MySQL 5.7 starting to support Multi-Source replication.
Generated Columns
There are two kinds of Generated Columns: virtual (default) and stored. Virtual means that the column will be calculated on the fly when a
record is read from a table. Stored means that the column will be calculated when a new record is written in the table, and after that it will be
treated as a regular field. Both types can have NOT NULL restrictions, but only a stored Generated Column can be be a part of an index.
Reference:
http://mysqlserverteam.com/generated-columns-in-mysql-5-7-5/
http://mablomy.blogspot.com/2015/03/auto-generated-columns-in-mysql-57-two.html
http://mechanics.flite.com/blog/2015/04/13/using-mysql-5-dot-7-generated-columns-to-avoid-error-1070/
www.vmcd.org
SYS schema In MySQL
New in MySQL 5.7.7, the MySQL sys schema (originally the ps_helper project) is now included by default within the MySQL server
Reference:
http://mysqlserverteam.com/the-mysql-sys-schema-in-mysql-5-7-7/
Improved alter user syntax support in 5.7
Change Alter user syntax and add more useful commands.
Reference:
http://mysqlblog.fivefarmers.com/2015/04/10/improved-alter-user-syntax-support-in-5-7/
www.vmcd.org
SSL/TLS IN MYSQL 5.7
Security is receiving more attention and MySQL 5.7 aims to be the most secure MySQL Server release ever.
Reference:
http://mysqlblog.fivefarmers.com/2015/04/09/ssltls-in-mysql-5-7/
Secondary Indexes on XML BLOBs
We can create secondary index on this Column with generated column feature
Reference:
http://mablomy.blogspot.com/2015/04/secondary-indexes-on-xml-blobs-in-mysql.html
www.vmcd.org
Emulating roles with expanded proxy user support in 5.7.7
Explain how to use proxy user in MySQL
Reference:
http://mysqlblog.fivefarmers.com/2015/04/08/emulating-roles-with-expanded-proxy-user-support-in-5-7-7/
1 of 22

Recommended

MySQL Oslayer performace optimization by
MySQL  Oslayer performace optimizationMySQL  Oslayer performace optimization
MySQL Oslayer performace optimizationLouis liu
1.4K views31 slides
Upgrading mysql version 5.5.30 to 5.6.10 by
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Vasudeva Rao
8.5K views13 slides
Introduction to ClustrixDB by
Introduction to ClustrixDBIntroduction to ClustrixDB
Introduction to ClustrixDBI Goo Lee
595 views48 slides
My sql storage engines by
My sql storage enginesMy sql storage engines
My sql storage enginesVasudeva Rao
995 views12 slides
Mater,slave on mysql by
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysqlVasudeva Rao
1.3K views36 slides
MySQL Backup and Security Best Practices by
MySQL Backup and Security Best PracticesMySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesLenz Grimmer
6.3K views45 slides

More Related Content

What's hot

MySQL 5.6 config 優化 by
MySQL 5.6 config 優化MySQL 5.6 config 優化
MySQL 5.6 config 優化Alexis Li
745 views17 slides
Percona Xtrabackup - Highly Efficient Backups by
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsMydbops
3.8K views45 slides
MySQL for Large Scale Social Games by
MySQL for Large Scale Social GamesMySQL for Large Scale Social Games
MySQL for Large Scale Social GamesYoshinori Matsunobu
4.5K views37 slides
MariaDB 10.5 binary install (바이너리 설치) by
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)NeoClova
444 views15 slides
Intro ProxySQL by
Intro ProxySQLIntro ProxySQL
Intro ProxySQLI Goo Lee
1.7K views38 slides
Highly Available MySQL/PHP Applications with mysqlnd by
Highly Available MySQL/PHP Applications with mysqlndHighly Available MySQL/PHP Applications with mysqlnd
Highly Available MySQL/PHP Applications with mysqlndJervin Real
4.9K views73 slides

What's hot(20)

MySQL 5.6 config 優化 by Alexis Li
MySQL 5.6 config 優化MySQL 5.6 config 優化
MySQL 5.6 config 優化
Alexis Li745 views
Percona Xtrabackup - Highly Efficient Backups by Mydbops
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
Mydbops3.8K views
MariaDB 10.5 binary install (바이너리 설치) by NeoClova
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)
NeoClova444 views
Intro ProxySQL by I Goo Lee
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
I Goo Lee1.7K views
Highly Available MySQL/PHP Applications with mysqlnd by Jervin Real
Highly Available MySQL/PHP Applications with mysqlndHighly Available MySQL/PHP Applications with mysqlnd
Highly Available MySQL/PHP Applications with mysqlnd
Jervin Real4.9K views
Parallel Replication in MySQL and MariaDB by Mydbops
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
Mydbops859 views
Why MySQL Replication Fails, and How to Get it Back by Sveta Smirnova
Why MySQL Replication Fails, and How to Get it BackWhy MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it Back
Sveta Smirnova2.8K views
Postgres the hardway by Dave Pitts
Postgres the hardwayPostgres the hardway
Postgres the hardway
Dave Pitts275 views
MySQL Server Backup, Restoration, and Disaster Recovery Planning by Lenz Grimmer
MySQL Server Backup, Restoration, and Disaster Recovery PlanningMySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery Planning
Lenz Grimmer4K views
Introduction to MariaDB MaxScale by I Goo Lee
Introduction to MariaDB MaxScaleIntroduction to MariaDB MaxScale
Introduction to MariaDB MaxScale
I Goo Lee345 views
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ... by Insight Technology, Inc.
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
vSphere vStorage: Troubleshooting Performance by ProfessionalVMware
vSphere vStorage: Troubleshooting PerformancevSphere vStorage: Troubleshooting Performance
vSphere vStorage: Troubleshooting Performance
ProfessionalVMware19.1K views
MySQL 5.7 - What's new and How to upgrade by Abel Flórez
MySQL 5.7 - What's new and How to upgradeMySQL 5.7 - What's new and How to upgrade
MySQL 5.7 - What's new and How to upgrade
Abel Flórez1.3K views
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for... by Severalnines
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...
Severalnines1.3K views
MySQL's new Secure by Default Install -- All Things Open October 20th 2015 by Dave Stokes
MySQL's new Secure by Default Install -- All Things Open October 20th 2015MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
Dave Stokes743 views
Middleware upgrade to Oracle Fusion Middleware(FMW) 12c.Real Case stories. by Andrejs Vorobjovs
Middleware upgrade to Oracle Fusion Middleware(FMW) 12c.Real Case stories. Middleware upgrade to Oracle Fusion Middleware(FMW) 12c.Real Case stories.
Middleware upgrade to Oracle Fusion Middleware(FMW) 12c.Real Case stories.
Andrejs Vorobjovs1.8K views
Implementing High Availability Caching with Memcached by Gear6
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with Memcached
Gear657.4K views

Viewers also liked

Nvmfs benchmark by
Nvmfs benchmarkNvmfs benchmark
Nvmfs benchmarkLouis liu
816 views13 slides
MyAWR another mysql awr by
MyAWR another mysql awrMyAWR another mysql awr
MyAWR another mysql awrLouis liu
3.4K views46 slides
MySQL Tokudb engine benchmark by
MySQL Tokudb engine benchmarkMySQL Tokudb engine benchmark
MySQL Tokudb engine benchmarkLouis liu
884 views16 slides
MySQL async message subscription platform by
MySQL async message subscription platformMySQL async message subscription platform
MySQL async message subscription platformLouis liu
1.3K views15 slides
Think of oracle and mysql bind value by
Think of oracle and mysql bind value Think of oracle and mysql bind value
Think of oracle and mysql bind value Louis liu
2.4K views17 slides
Using preferred read groups in oracle asm michael ault by
Using preferred read groups in oracle asm michael aultUsing preferred read groups in oracle asm michael ault
Using preferred read groups in oracle asm michael aultLouis liu
2.4K views10 slides

Viewers also liked(20)

Nvmfs benchmark by Louis liu
Nvmfs benchmarkNvmfs benchmark
Nvmfs benchmark
Louis liu816 views
MyAWR another mysql awr by Louis liu
MyAWR another mysql awrMyAWR another mysql awr
MyAWR another mysql awr
Louis liu3.4K views
MySQL Tokudb engine benchmark by Louis liu
MySQL Tokudb engine benchmarkMySQL Tokudb engine benchmark
MySQL Tokudb engine benchmark
Louis liu884 views
MySQL async message subscription platform by Louis liu
MySQL async message subscription platformMySQL async message subscription platform
MySQL async message subscription platform
Louis liu1.3K views
Think of oracle and mysql bind value by Louis liu
Think of oracle and mysql bind value Think of oracle and mysql bind value
Think of oracle and mysql bind value
Louis liu2.4K views
Using preferred read groups in oracle asm michael ault by Louis liu
Using preferred read groups in oracle asm michael aultUsing preferred read groups in oracle asm michael ault
Using preferred read groups in oracle asm michael ault
Louis liu2.4K views
Architecture of YHD by Louis liu
Architecture of YHDArchitecture of YHD
Architecture of YHD
Louis liu851 views
基于Mongodb的压力评测工具 ycsb的一些概括 by Louis liu
基于Mongodb的压力评测工具 ycsb的一些概括基于Mongodb的压力评测工具 ycsb的一些概括
基于Mongodb的压力评测工具 ycsb的一些概括
Louis liu2.6K views
HBASE Performane Test by Louis liu
HBASE Performane TestHBASE Performane Test
HBASE Performane Test
Louis liu1.4K views
Q315 citi-conf-090915 by sandisk2015
Q315 citi-conf-090915Q315 citi-conf-090915
Q315 citi-conf-090915
sandisk201530K views
How to study oracle by louis liu by Louis liu
How to study oracle by louis liu How to study oracle by louis liu
How to study oracle by louis liu
Louis liu4.9K views
Rapid Application Design in Financial Services by Aerospike
Rapid Application Design in Financial ServicesRapid Application Design in Financial Services
Rapid Application Design in Financial Services
Aerospike898 views
Infiniflash benchmark by Louis liu
Infiniflash benchmarkInfiniflash benchmark
Infiniflash benchmark
Louis liu446 views
Exadata training by Louis liu
Exadata trainingExadata training
Exadata training
Louis liu1.8K views
Is the World Ready for Big Data Flash? by Jonathan Long
Is the World Ready for Big Data Flash?Is the World Ready for Big Data Flash?
Is the World Ready for Big Data Flash?
Jonathan Long232 views
Flash memory summit 2015 gary lyng session 301-a by GARY LYNG
Flash memory summit 2015   gary lyng session 301-aFlash memory summit 2015   gary lyng session 301-a
Flash memory summit 2015 gary lyng session 301-a
GARY LYNG282 views

Similar to MySQL 5.7 milestone

Ebook7 by
Ebook7Ebook7
Ebook7kaashiv1
301 views19 slides
Sql interview question part 7 by
Sql interview question part 7Sql interview question part 7
Sql interview question part 7kaashiv1
304 views19 slides
UPD_OP_SQL by
UPD_OP_SQLUPD_OP_SQL
UPD_OP_SQLValapet Badri
394 views5 slides
Servlets and jsp pages best practices by
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practicesejjavies
1.9K views6 slides
Ebook11 by
Ebook11Ebook11
Ebook11kaashiv1
263 views19 slides
Whitepaper Performance Tuning using Upsert and SCD (Task Factory) by
Whitepaper  Performance Tuning using Upsert and SCD (Task Factory)Whitepaper  Performance Tuning using Upsert and SCD (Task Factory)
Whitepaper Performance Tuning using Upsert and SCD (Task Factory)MILL5
1.2K views19 slides

Similar to MySQL 5.7 milestone(20)

Ebook7 by kaashiv1
Ebook7Ebook7
Ebook7
kaashiv1301 views
Sql interview question part 7 by kaashiv1
Sql interview question part 7Sql interview question part 7
Sql interview question part 7
kaashiv1304 views
Servlets and jsp pages best practices by ejjavies
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practices
ejjavies1.9K views
Ebook11 by kaashiv1
Ebook11Ebook11
Ebook11
kaashiv1263 views
Whitepaper Performance Tuning using Upsert and SCD (Task Factory) by MILL5
Whitepaper  Performance Tuning using Upsert and SCD (Task Factory)Whitepaper  Performance Tuning using Upsert and SCD (Task Factory)
Whitepaper Performance Tuning using Upsert and SCD (Task Factory)
MILL51.2K views
High performance coding practices code project by Pruthvi B Patil
High performance coding practices code projectHigh performance coding practices code project
High performance coding practices code project
Pruthvi B Patil498 views
Tuning and optimizing webcenter spaces application white paper by Vinay Kumar
Tuning and optimizing webcenter spaces application white paperTuning and optimizing webcenter spaces application white paper
Tuning and optimizing webcenter spaces application white paper
Vinay Kumar1.6K views
Whatsnew in-my sql-primary by Kaizenlogcom
Whatsnew in-my sql-primaryWhatsnew in-my sql-primary
Whatsnew in-my sql-primary
Kaizenlogcom72 views
Jsp and Servlets by Raghu nath
Jsp and ServletsJsp and Servlets
Jsp and Servlets
Raghu nath654 views
UEMB240: Managing Your User Profile Data at Scale by Ivanti
UEMB240: Managing Your User Profile Data at ScaleUEMB240: Managing Your User Profile Data at Scale
UEMB240: Managing Your User Profile Data at Scale
Ivanti137 views
Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by... by Trivadis
Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...
Trivadis TechEvent 2016 What's new in SQL Server 2016 in Analysis Services by...
Trivadis209 views
Myth busters - performance tuning 102 2008 by paulguerin
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008
paulguerin296 views
Top 10 my sql 5.7 variables we consider changing immediately after successful... by MinervaDB
Top 10 my sql 5.7 variables we consider changing immediately after successful...Top 10 my sql 5.7 variables we consider changing immediately after successful...
Top 10 my sql 5.7 variables we consider changing immediately after successful...
MinervaDB494 views
Java Standard Edition 6 Performance by white paper
Java Standard Edition 6 PerformanceJava Standard Edition 6 Performance
Java Standard Edition 6 Performance
white paper590 views

More from Louis liu

Tcpcopy benchmark by
Tcpcopy benchmarkTcpcopy benchmark
Tcpcopy benchmarkLouis liu
237 views9 slides
JK Log-Center architect by
JK Log-Center architectJK Log-Center architect
JK Log-Center architectLouis liu
163 views7 slides
Wdt Test by
Wdt TestWdt Test
Wdt TestLouis liu
278 views8 slides
JKDB BACKUP Introduction by
JKDB BACKUP IntroductionJKDB BACKUP Introduction
JKDB BACKUP IntroductionLouis liu
131 views15 slides
Jkcn MySQLDB 架构 by
Jkcn MySQLDB 架构Jkcn MySQLDB 架构
Jkcn MySQLDB 架构Louis liu
837 views15 slides
My sql fabric ha and sharding solutions by
My sql fabric ha and sharding solutionsMy sql fabric ha and sharding solutions
My sql fabric ha and sharding solutionsLouis liu
1.4K views35 slides

More from Louis liu(19)

Tcpcopy benchmark by Louis liu
Tcpcopy benchmarkTcpcopy benchmark
Tcpcopy benchmark
Louis liu237 views
JK Log-Center architect by Louis liu
JK Log-Center architectJK Log-Center architect
JK Log-Center architect
Louis liu163 views
Wdt Test by Louis liu
Wdt TestWdt Test
Wdt Test
Louis liu278 views
JKDB BACKUP Introduction by Louis liu
JKDB BACKUP IntroductionJKDB BACKUP Introduction
JKDB BACKUP Introduction
Louis liu131 views
Jkcn MySQLDB 架构 by Louis liu
Jkcn MySQLDB 架构Jkcn MySQLDB 架构
Jkcn MySQLDB 架构
Louis liu837 views
My sql fabric ha and sharding solutions by Louis liu
My sql fabric ha and sharding solutionsMy sql fabric ha and sharding solutions
My sql fabric ha and sharding solutions
Louis liu1.4K views
NetApp ef540 SSD Storage Test by Louis liu
NetApp ef540 SSD Storage TestNetApp ef540 SSD Storage Test
NetApp ef540 SSD Storage Test
Louis liu740 views
Exadata best practice on E-commerce area by Louis liu
Exadata best practice on E-commerce area Exadata best practice on E-commerce area
Exadata best practice on E-commerce area
Louis liu1K views
MySQL 5.5&5.6 new features summary by Louis liu
MySQL 5.5&5.6 new features summaryMySQL 5.5&5.6 new features summary
MySQL 5.5&5.6 new features summary
Louis liu1.6K views
Ssd gc review by Louis liu
Ssd gc reviewSsd gc review
Ssd gc review
Louis liu1.1K views
1号店数据库架构 by Louis liu
1号店数据库架构1号店数据库架构
1号店数据库架构
Louis liu2.6K views
Oracle dgha by Louis liu
Oracle dghaOracle dgha
Oracle dgha
Louis liu2K views
ION performance brief hp dl980-8b by Louis liu
ION performance brief   hp dl980-8bION performance brief   hp dl980-8b
ION performance brief hp dl980-8b
Louis liu1.6K views
Recent my sql_performance Test detail by Louis liu
Recent my sql_performance Test detailRecent my sql_performance Test detail
Recent my sql_performance Test detail
Louis liu604 views
Advanced tips of dbms statas by Louis liu
Advanced tips of dbms statasAdvanced tips of dbms statas
Advanced tips of dbms statas
Louis liu739 views
Optimizer in oracle 11g by wwf from ebay COC by Louis liu
Optimizer in oracle 11g by wwf from ebay COCOptimizer in oracle 11g by wwf from ebay COC
Optimizer in oracle 11g by wwf from ebay COC
Louis liu1.6K views
FusionIO iodrive2 vs LSI nytro vs VIRI Flashmax II by Louis liu
FusionIO  iodrive2 vs LSI nytro  vs VIRI Flashmax IIFusionIO  iodrive2 vs LSI nytro  vs VIRI Flashmax II
FusionIO iodrive2 vs LSI nytro vs VIRI Flashmax II
Louis liu2K views
Mha procedure by Louis liu
Mha procedureMha procedure
Mha procedure
Louis liu634 views
基于MHA的MySQL高可用方案 by Louis liu
基于MHA的MySQL高可用方案基于MHA的MySQL高可用方案
基于MHA的MySQL高可用方案
Louis liu5.2K views

Recently uploaded

Zero to Automated in Under a Year by
Zero to Automated in Under a YearZero to Automated in Under a Year
Zero to Automated in Under a YearNetwork Automation Forum
15 views23 slides
handbook for web 3 adoption.pdf by
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdfLiveplex
22 views16 slides
Microsoft Power Platform.pptx by
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptxUni Systems S.M.S.A.
53 views38 slides
Uni Systems for Power Platform.pptx by
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
56 views21 slides
Network Source of Truth and Infrastructure as Code revisited by
Network Source of Truth and Infrastructure as Code revisitedNetwork Source of Truth and Infrastructure as Code revisited
Network Source of Truth and Infrastructure as Code revisitedNetwork Automation Forum
26 views45 slides
AMAZON PRODUCT RESEARCH.pdf by
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdfJerikkLaureta
26 views13 slides

Recently uploaded(20)

handbook for web 3 adoption.pdf by Liveplex
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdf
Liveplex22 views
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta26 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker37 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi127 views
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software263 views
The details of description: Techniques, tips, and tangents on alternative tex... by BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada127 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab19 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada136 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
Attacking IoT Devices from a Web Perspective - Linux Day by Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri16 views

MySQL 5.7 milestone

  • 1. www.vmcd.org MySQL 5.7 Important Features InnoDB Read-Only Scalability Improving the performance for Read-Only and Read-Mostly workloads. Significantly improved how InnoDB handles RO trans-actions Removed server layer contentions related to Meta Data Locking (MDL) and removed the use of “thread locks” (thd_locks) for InnoDB In MySQL 5.7.2, there is another optimization where all transactions are treated as a read-only transactions by default, and a transaction is only assigned an ID and a rollback segment when the transaction attempts to do its first update. This optimization of treating all transactions as read-only by default has the additional benefit that users do not need to use special syntax or change their applications to take advantage of it. Reference: http://dimitrik.free.fr/blog/archives/09-01-2013_09-30-2013.html http://mysqlserverteam.com/mysql-5-7-over-1m-qps-with-innodb-memcached-plugin/ http://mysqlserverteam.com/transaction-life-cycle-improvements-in-5-7-3/ http://mysqlserverteam.com/mysql-5-7-3-deep-dive-into-1mil-qps-with-innodb-memcached/
  • 2. www.vmcd.org InnoDB Read-Write Scalability. Improved the performance of Read-Write (RW) workloads. We have removed the “index lock contention” in InnoDB. The index lock that was used to protect the entire index tree structure is now replaced by more fine grained “block locks” in the tree. InnoDB has two "modes" when updating the Btrees. An optimistic mode and a pessimistic mode. They roughly correspond to in-place changes and tree modification changes. If InnoDB thinks that an insert/delete will result in a tree modification change it will lock the index in X mode. This blocks readers too and limits concurrency. The fix was to introduce a new lock mode SX. This reduces the need to lock the entire Btree during tree modification changes. Reference: https://blogs.oracle.com/mysqlinnodb/entry/innodb_5_7_performance_improvements http://mysqlserverteam.com/mysql-5-7-improves-dml-oriented-workloads/ https://blogs.oracle.com/mysqlinnodb/entry/innodb_5_7_performance_improvements
  • 3. www.vmcd.org InnoDB Faster & Parallel Flushing InnoDB has had some sub-optimal code around traversing the dirty page and LRU list flushing. The problem was that when we release the buffer pool and associated mutexes during the IO phase we can no longer trust the iterator that is used to scan the aforementioned lists. So, we restart the scan from the start. The fix was to track whether the iterator was invalidated while the covering mutexes where released. If the iterator was not invalidated then we can carry on from where we left off. If on the other hand we detect that it was invalidated we go back to the start and do it the old way. The iterator invalidation should be very rare. Reducing the number of pages scanned when doing flush list batches, speeding up page flushing Recently our benchmarks showed that we are scanning excessive number of pages when doing flush list batches. We fixed it by introducing the concept of Hazard Pointer which reduced the time complexity of scan from O(n*n) to O(n). This WL builds on that to extend the same concept to other scans within buffer pool. There are significant other changes which are made as part of reduced scanning logic. The time complexity of a scan is reduced from O(n*n) to O(n). We have also implemented parallel flushing by having multiple page_cleaner threads Reference: https://blog.mariadb.org/performance-evaluation-of-mariadb-10-1-and-mysql-5-7-4-labs-tplc/
  • 4. www.vmcd.org Speeding up Connection Handling In 5.7 we have offloaded thread initialization and network initialization to a worker thread and more than doubled MySQL’s ability to do high frequency connect/disconnect cycles, from 26K to 56K connect/disconnect cycles per second Reference: http://mysqlserverteam.com/improving-connectdisconnect-performance/ Bulk Data Load Improvements Bulk Load for Create Index – Faster index creation This method of index creation is also known as a “sorted index build”. This enhancement, which improves the efficiency of index creation, also applies to full-text indexes. A new global configuration option, innodb_fill_factor, defines the percentage of space on each page that is filled with data during a sorted index build, with the remaining space reserved for future index growth. For more information, see Section 14.13.18, “Bulk Load for CREATE INDEX”.
  • 5. www.vmcd.org Bulk INSERT operations can be sped up by creating the secondary indexes afterwards. In this way, the records will be merge sorted and then inserted into the InnoDB index B-trees in order, using sequentially allocated pages. This will create a more optimal layout especially for indexes whose columns are updated rarely Resize the InnoDB Buffer Pool Online Change “ innodb_buffer_pool_size“ dynamically. Reference: http://mysqlserverteam.com/resizing-buffer-pool-online/ Automatic Truncation of UNOD Logs Need separate UNDO tablespaces have been configured. Reference: http://mysqllover.com/?p=1051
  • 6. www.vmcd.org InnoDB Online Alter Table Onine rename index and enlarge varchar column size Online Rename Index This work by Marko Mäkelä (WL#6752) and Dmitry Lenev (WL#6555) makes it possible to rename an index as an online operation. Example: mysql> ALTER TABLE t RENAME INDEX i1 TO i2; Enlarge VARCHAR column size online (WL#6554) This work by Marko Mäkelä makes it possible to enlarge varchar column sizes as an online operation. This is true as long as the number of bytes required by the VARCHAR column type (VARCHAR/LONGVARCHAR) remains the same, i.e. from 0 to 255 or from 256 to higher. Example: mysql> ALTER TABLE t1 ALGORITHM=INPLACE, CHANGE COLUMN c1 c1 VARCHAR(255); Setting Replication Filters Without Server Restart Dynamically change Filter behaviors without restart server Reference: http://mysqlserverteam.com/mysql-5-7-3-making-mysql-slave-replication-filters-dynamic/
  • 7. www.vmcd.org CHANGE MASTER Without Stopping the SQL Thread In order to add/alter an option using the CANGE MASTER TO command, it was previously necessary to issue a STOP SLAVE command before the CHANGE MASTER TO command. This work relaxes that constraint. Reference: http://mysqlserverteam.com/mysql-5-7-4-change-master-without-stopping-slave-altogether/ http://work.shivjijha.com/2014/04/change-master-without-stopping-slave.html Improved “IN queries” With Row Value Expressions to Be Executed Using Range Scans As of 5.7.3 this hole in the net is stitched up. The range optimizer gladly opens the door for queries with IN predicates as long as The predicate is only IN, not NOT IN. The row on the predicate’s left-hand side is only indexed column references, in the same index. The rows contain only constants or come from a previously read table in nested-loops join. Note that ‘constants’ is a pretty broad category. It consists of pre-evaluated expressions, even some sub-queries, SQL variables and similar beings
  • 8. www.vmcd.org Improving performance when using in predicates Reference: http://mysqlserverteam.com/range-access-now-in-an-in-predicate-near-you/ UNION ALL” No Longer Creates a Temporary Table In 5.7 the optimizer avoids creating a temporary table for the result of UNION ALL queries when there is no need for it, i.e., when there is no top-level ORDER BY clause Reference: http://mysqlserverteam.com/state-of-the-union/
  • 9. www.vmcd.org EXPLAIN for Running Queries This feature is useful if you are running a statement in one session that is taking a long time to complete; using EXPLAIN FOR CONNECTION in another session may yield useful information about the cause of the delay and thus help you optimize your schema and statements. JSON EXPLAIN Make Use of Condition Filtering in the Optimizer Reference: http://mysqlserverteam.com/a-new-dimension-to-mysql-query-optimizations-part-1/ http://mysqlserverteam.com/a-new-dimension-to-mysql-query-optimizations-part-2/
  • 10. www.vmcd.org Improved ONLY_FULL_GROUP_BY SQL Mode ONLY_FULL_GROUP_BY SQL mode was enabled by default in 5.75+ In MySQL, one can write GROUP BY queries that reference non-aggregated columns in the SELECT list that are not included in the GROUP BY clause, even if these columns are not functionally dependent upon the GROUP BY clause. This behaviour conforms to none of the SQL standard's versions. It is possible to avoid this behaviour by including ONLY_FULL_GROUP_BY in the sql_mode server setting, but it might make more sense to take advantage of the ability to write only partial GROUP BY clauses. In a nutshell: It is completely safe to write partial GROUP BY clauses as long as all non-aggregated columns in the SELECT list are functionally dependent upon the GROUP BY clause. A partial GROUP BY list can result in better performance, because it keeps the server from evaluating the entire GROUP BY list. If one does not want to write partial GROUP BY clauses, consider using MIN or MAX to 'aggregate' the functionally dependent columns in the SELECT list rather than moving the functionally dependent columns to the GROUP BY clause. Reference: http://rpbouman.blogspot.co.uk/2007/05/debunking-group-by-myths.html http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/
  • 11. www.vmcd.org Copying File-Per-Table Tablespaces to Another Server Prior to MySQL 5.7.4, only non-partitioned InnoDB tables are supported. As of MySQL 5.7.4, partitioned InnoDB tables and individual InnoDB table partitions and subpartitions are also supported. Reference: https://dev.mysql.com/doc/refman/5.7/en/tablespace-copying.html InnoDB Buffer Pool Dump and Load Enhancements This work improves both the dump and load scenarios. It is now possible to dump only the hottest N% of the pages from each buffer pool. The load operation is also made less disruptive to user activity because the load now happens in the background while continuing to serve clients Reference:
  • 12. www.vmcd.org http://mysqlserverteam.com/mysql-dumping-and-reloading-the-innodb-buffer-pool/ http://mysqllover.com/?p=1123 Statement Timeouts MySQL 5.7.4 introduces the ability to set server side execution time limits, specified in milliseconds, for top level read-only SELECT statements. This feature is introduced as part of WL#6936. It is based on a contribution submitted by Davi Arnaut with Bug#68252. Thank you, Davi! The statement timeouts work by interrupting the execution of the statement when it takes longer than a specified number of milliseconds to complete. After the specified number of milliseconds has passed, the server aborts the individual query without affecting the larger transaction or connection contexts. The following error is then reported to the client when the query is aborted: 1907: Query execution was interrupted, max_statement_time exceeded. To be clear, the execution time limit specified is really a “soft hint”, because the query interruption may not happen precisely at the specified execution time limit. There can be a minor delay between the timer expiration and the actual query interruption. A time limit for any SELECT statement run against a MySQL instance can be set by specifying a timeout value in milliseconds for the GLOBAL system variable max_statement_time.
  • 13. www.vmcd.org Reference: http://planet.mysql.com/entry/?id=673840 http://mysqlserverteam.com/server-side-select-statement-timeouts/ Multiple User Level Locks The difference in lock acquisition behavior as of MySQL 5.7.5 can be seen by the following example. Suppose that you execute these statements: SELECT GET_LOCK('lock1',10); SELECT GET_LOCK('lock2',10); SELECT RELEASE_LOCK('lock2'); SELECT RELEASE_LOCK('lock1'); In MySQL 5.7.5 or later, the second GET_LOCK() acquires a second lock and both RELEASE_LOCK() calls return 1 (success). Before MySQL 5.7.5, the second GET_LOCK() releases the first lock ('lock1') and the secondRELEASE_LOCK() returns NULL (failure) because there is no 'lock1' to release.
  • 14. www.vmcd.org Waiting for More Transactions to Enter Binlog Group Commit (BGC) Queues Solve the lag problem in MySQL slave database. We could read Booking’s article for cascade M-S architecture. binlog-group-commit-sync-delay, binlog-group-commit-sync-no-delay-count were used to control BGC. Reference: http://blog.booking.com/evaluating_mysql_parallel_replication_2-slave_group_commit.html Semi-Sync Replication Make the Master Wait for More than One Slave to Acknowledge Back Externalize Transactions Only after ACK is Received Semi-Sync — Separate ACKs Collector Reference:
  • 15. www.vmcd.org http://my-replication-life.blogspot.sg/2013/12/enforced-semi-synchronous-replication.html http://my-replication-life.blogspot.sg/2013/12/enforced-semi-synchronous-replication.html http://my-replication-life.blogspot.sg/2014/03/faster-semisync-replication.html Multi-Threaded Slaves (MTS) Intra-Schema Parallel Slave Execution Reference: http://geek.rohitkalhans.com/2013/09/enhancedMTS-configuration.html Ordered Commits (Sequential Consistency) Ensure that the commits by slave applier threads running in parallel will be done in the same order as they were on the master.
  • 16. www.vmcd.org Support Slave Transaction Retries in Multi-Threaded Slave Mode Transaction retry feature works for both types of mutli-threaded slave(database based and logical clock based). It also works fine when you force slave to commit transactions in same order as master by setting system variable “slave_preserve_commit_order” to ON. By default, transaction retry is on for all types of slave. Multi-threaded slave will not break if it just encounters some temporary errors mentioned above. TRUNCATE TABLE Statement Becomes Atomic This work makes the internal InnoDB TRUNCATE TABLE statement atomic by reinitializing the original table-space header with the same space id and then physically truncating its.ibd file during the truncation of a single table tablespace. Reference: http://mysqllover.com/?p=1053
  • 17. www.vmcd.org InnoDB Create Tablespace in 5.7 CREATE TABLESPACE `TBS_DADOS_COMPRESS` ADD DATAFILE 'TDS_DC_DATAFILE1.ibd' [FILE_BLOCK_SIZE=4]; CREATE TABLESPACE `TBS_DADOS` ADD DATAFILE 'TDS_D_DATAFILE1.ibd' [FILE_BLOCK_SIZE=8]; CREATE TABLE ITEM_VENDA TABLESPACE=`TBS_DADOS_COMPRESS`; ALTER TABLE tbl_name TABLESPACE=`TBS_DADOS` DROP TABLESPACE `TBS_DADOS_COMPRESS`; Reference: http://mathiasbrem.com.br/innodb-create-tablespace-mysql-5-7/ InnoDB Native Partitioning Less handles less use of memory. Easy to access partition tables Reference:
  • 18. www.vmcd.org http://mysqlserverteam.com/innodb-native-partitioning-early-access/ InnoDB Temporary Table Performance Temporary Tables Faster create/drop No redo logging Separate tablespace for all uncompressed temporary tables Temporary tables don't require recovery therefore there is no point in saving their definitions in the persistent data dictionary. By putting the all the temporary tables in a special tablespace that is not redo logged we can reduce a lot of the unnecessary overhead. We do UNDO log the changes to temporary tables, this is required for rollback to savepoint. However, the UNDO logs for temporary tables are not redo logged and the UNDO logs for temporary tables also reside in the special temporary tablespace. Temp tables are only visible within the connection/session in which they were created, and they are bound by the lifetime of the server. We optimized DML for Temp Tables (WL#6470) by removing unnecessary UNDO and REDO logging, change buffering, and locking. We added an additional type of UNDO log (WL#6915), one that is not REDO logged and resides in a new separate temp tablespace.
  • 19. www.vmcd.org Multi-Source Replication Nearly MariaDB. MySQL 5.7 starting to support Multi-Source replication. Generated Columns There are two kinds of Generated Columns: virtual (default) and stored. Virtual means that the column will be calculated on the fly when a record is read from a table. Stored means that the column will be calculated when a new record is written in the table, and after that it will be treated as a regular field. Both types can have NOT NULL restrictions, but only a stored Generated Column can be be a part of an index. Reference: http://mysqlserverteam.com/generated-columns-in-mysql-5-7-5/ http://mablomy.blogspot.com/2015/03/auto-generated-columns-in-mysql-57-two.html http://mechanics.flite.com/blog/2015/04/13/using-mysql-5-dot-7-generated-columns-to-avoid-error-1070/
  • 20. www.vmcd.org SYS schema In MySQL New in MySQL 5.7.7, the MySQL sys schema (originally the ps_helper project) is now included by default within the MySQL server Reference: http://mysqlserverteam.com/the-mysql-sys-schema-in-mysql-5-7-7/ Improved alter user syntax support in 5.7 Change Alter user syntax and add more useful commands. Reference: http://mysqlblog.fivefarmers.com/2015/04/10/improved-alter-user-syntax-support-in-5-7/
  • 21. www.vmcd.org SSL/TLS IN MYSQL 5.7 Security is receiving more attention and MySQL 5.7 aims to be the most secure MySQL Server release ever. Reference: http://mysqlblog.fivefarmers.com/2015/04/09/ssltls-in-mysql-5-7/ Secondary Indexes on XML BLOBs We can create secondary index on this Column with generated column feature Reference: http://mablomy.blogspot.com/2015/04/secondary-indexes-on-xml-blobs-in-mysql.html
  • 22. www.vmcd.org Emulating roles with expanded proxy user support in 5.7.7 Explain how to use proxy user in MySQL Reference: http://mysqlblog.fivefarmers.com/2015/04/08/emulating-roles-with-expanded-proxy-user-support-in-5-7-7/