mysql features
DESCRIPTION
Great Wide Open 2014 - Day 1 Max Mether - SkySQL 11:15 AM - Operations 1 (Databases)TRANSCRIPT
MySQL Features Max Mether
@maxmether [email protected]
17.04.2014 © SkySQL Ab. Commercial in Confidence 1
Who is Max ?
Early days
• 1983 - First version of what would become MySQL created by Monty Widenius
• 1991 – The platform is EOLd
• 1994 – Open source MySQL is released
• 1995 – MySQL AB founded
• 1996 – the LAMP stack rulez
17.04.2014
SkySQL Ab 2011 Confidential 3
Sucessful growth
• 1999 Jul – MySQL 3.23. alpha released
• 2000 – InnoDB released as part of MySQL-max
• 2001 Jan – MySQL 3.23 GA
• 2001 Jan – Mårten Mickos joins MySQL as the CEO
• 2003 Mar – MySQL 4.0 GA
• 2004 Oct – MySQL 4.1 GA
17.04.2014
SkySQL Ab 2011 Confidential 4
Volatility
• 2005 Oct – Oracle acquires InnoDB (Innobase) • 2005 Oct – MySQL 5.0 GA • 2005 Nov – Pluggable storage engines • 2008 Jan – MySQL AB acquired by Sun for $1bn • 2008 Nov – MySQL 5.1 GA • 2008 Dec – Monty Program founded • 2008 Dec – XtraDB released • 2009 Apr – Oracle acquire Sun for $7.4bn • 2009 Dec – Oracle makes MySQL promises to EU
17.04.2014
SkySQL Ab 2011 Confidential 5
A new beginning?
• 2010 Feb – MariaDB 5.1 alpha released • 2010 Dec – MySQL 5.5 GA released • 2011 Sep – Oracle: closed source modules for MySQL • 2012 Apr – MariaDB 5.5 GA is released • 2012 Aug – Oracle: closes bugs db and test cases • 2012 Dec – MariaDB Foundation is announced • 2013 Feb – MySQL 5.6 GA is released • 2013 Feb – Fedora and OpenSuSE replace MySQL with
MariaDB in their distributions
17.04.2014
SkySQL Ab 2011 Confidential 6
MySQL Versions through time
17.04.2014
SkySQL Ab 2011 Confidential 7
MySQL AB 3.23 4.0 4.1 5.0 5.1 5.2 6.0
Sun 5.1 5.2 5.4 6.0
Oracle 5.4 5.5 5.6 6.0 5.7
MariaDB 5.1 5.2 5.3 5.5 10.0 10.1
A brief history • 1983 - First version of what would become MySQL created by Monty
Widenius
• 1995 – MySQL AB founded
• 2001 Jan – Mårten Mickos joins MySQL as the CEO
• 2005 Oct – Oracle acquires InnoDB (Innobase)
• 2008 Jan – MySQL AB acquired by Sun for $1bn
• 2008 Nov – MySQL 5.1 GA
• 2009 Jan – Monty Program is founded
• 2009 Apr – Oracle acquire Sun for $7.4bn
• 2009 Dec – Oracle makes MySQL promises to EU
17.04.2014
8
A new beginning? • 2010 Feb – MariaDB 5.1 alpha released
• 2010 Dec – MySQL 5.5 GA released
• 2011 Sep – Oracle: closed source modules for MySQL
• 2012 Apr – MariaDB 5.5 GA is released
• 2012 Aug – Oracle: closes bugs db and test cases
• 2012 Dec – MariaDB Foundation is announced
• 2013 Feb – Fedora and OpenSuSE replace MySQL with MariaDB in their distributions
• 2013 Mar – Slackware, Archware follow
• 2013 April - SkySQL merges with Monty Program
• 2013 June – RHEL announces MariaDB as default
17.04.2014
SkySQL Ab 2011 Confidential 9
MySQL 5.6: InnoDB Performance
• Internal Improvements – Split kernel mutex – Efficient buffer pool
• Persistent optimizer statistics – More accurate statistics
• SSD Optimizations – 4k, 8k page sizes – .ibd files outside MySQL data dir – Separate tablespace for undo log
• Dump and restore warm buffer pool – Limited disk foot print
MySQL 5.6: InnoDB Features
• Online DDL – CREATE/DROP INDEX – Change AUTO_INCREMENT value for a column – ADD/DROP FOREIGN KEY – ADD/DROP/RENAME COLUMN – Change ROW FORMAT, KEY_BLOCK_SIZE for a table – Change COLUMN NULL, NOT_NULL
• Transportable tablespaces – FLUSH TABLE test FOR EXPORT; – ALTER TABLE test DISCARD TABLESPACE; – ALTER TABLE test IMPORT TABLESPACE;
MySQL 5.6: InnoDB Features
• Fulltext search
– Same syntax as for MyISAM tables previously
• Memcached plugin
– Key-value access to InnoDB via memcached API
– Fully transactional
create table quotes
(id int unsigned
auto_increment primary
key,
author varchar(64),
quote varchar(4000),
source varchar(64),
fulltext(quote))
engine=innodb;
select author from quotes
where match(quote) against (‘apple' in natural language mode);
MySQL 5.6: Replication
• GTID (Global Transaction ID) – Simple to track and compare across replication
hierarchies – Automatically identify most up-to-date slave – Easy automatic reconfiguration when master changes
• Replication HA utilities – mysqlfailover – mysqlrpladmin
• Multi threaded slaves – One thread per schema
MySQL 5.6: Replication
• Crash safe slave – Replication state stored in InnoDB table
– Eliminates risk of replication state information loss
• Optimized row-image – Only changed data stored
– binlog-row-image=minimal
• Event checksums – Detects corrupt replication events before applied
– Returns an error
MySQL 5.6: Performance Schema
New Instrumentation • Statements/Stages • Table and Index I/O • Table locks • Users/Hosts/Accounts • Network I/O
New Features • Show contents of Host
cache • New Summary tables
– Grouped by thread, user, host, account or object
• Easier configuration – Start up defaults in my.cnf – Auto tune
• Reduced overhead • On by default
MySQL 5.6: Improved Partitioning
• Up to 8k partitions/sub-partitions per table
• Explicit partition selection in queries, DML (SELECT, INSERT, UPDATE,DELETE, REPLACE, LOAD DATA, LOAD XML)
• Import/export partitions to/from partitioned tables to/from non-partitioned tables
MySQL 5.6: Improved Partitioning MariaDB [employees]> select * from emp_temp order by emp_no limit 10;
+--------+------------+------------+---------------+--------+------------+
| emp_no | birth_date | first_name | last_name | gender | hire_date |
+--------+------------+------------+---------------+--------+------------+
| 10241 | 1958-07-01 | Ortrud | Murillo | M | 1988-06-12 |
| 10245 | 1962-08-23 | Ramalingam | Gente | F | 1985-04-26 |
| 10249 | 1954-06-10 | Marie | Boreale | M | 1991-12-08 |
| 10253 | 1964-11-12 | Zsolt | Salinas | F | 1985-02-21 |
| 10257 | 1957-09-12 | Aiman | Riexinger | M | 1986-08-05 |
| 10261 | 1959-12-25 | Mang | Erie | M | 1993-10-20 |
| 10265 | 1960-12-01 | Ramalingam | Muniz | M | 1989-07-13 |
| 10269 | 1959-10-07 | Taizo | Oxman | F | 1988-07-24 |
| 10273 | 1962-08-29 | Baocai | Lieblein | M | 1985-11-06 |
| 10277 | 1964-08-15 | Isaac | Schwartzbauer | M | 1985-06-16 |
+--------+------------+------------+---------------+--------+------------+
10 rows in set (0.00 sec)
MariaDB [employees]> select * from employees_part partition (p0) order by emp_no limit 10;
+--------+------------+------------+-----------+--------+------------+
| emp_no | birth_date | first_name | last_name | gender | hire_date |
+--------+------------+------------+-----------+--------+------------+
| 1 | 0000-00-00 | max | | M | 0000-00-00 |
+--------+------------+------------+-----------+--------+------------+
1 row in set (0.00 sec)
MySQL 5.6: Improved Partitioning MariaDB [employees]> alter table employees_part exchange partition p0 with table emp_temp;
Query OK, 0 rows affected (0.14 sec)
MariaDB [employees]> select * from employees_part partition (p0) order by emp_no limit 10;
+--------+------------+------------+---------------+--------+------------+
| emp_no | birth_date | first_name | last_name | gender | hire_date |
+--------+------------+------------+---------------+--------+------------+
| 10241 | 1958-07-01 | Ortrud | Murillo | M | 1988-06-12 |
| 10245 | 1962-08-23 | Ramalingam | Gente | F | 1985-04-26 |
| 10249 | 1954-06-10 | Marie | Boreale | M | 1991-12-08 |
| 10253 | 1964-11-12 | Zsolt | Salinas | F | 1985-02-21 |
| 10257 | 1957-09-12 | Aiman | Riexinger | M | 1986-08-05 |
| 10261 | 1959-12-25 | Mang | Erie | M | 1993-10-20 |
| 10265 | 1960-12-01 | Ramalingam | Muniz | M | 1989-07-13 |
| 10269 | 1959-10-07 | Taizo | Oxman | F | 1988-07-24 |
| 10273 | 1962-08-29 | Baocai | Lieblein | M | 1985-11-06 |
| 10277 | 1964-08-15 | Isaac | Schwartzbauer | M | 1985-06-16 |
+--------+------------+------------+---------------+--------+------------+
10 rows in set (0.00 sec)
MariaDB [employees]> select * from emp_temp order by emp_no limit 10;
+--------+------------+------------+-----------+--------+------------+
| emp_no | birth_date | first_name | last_name | gender | hire_date |
+--------+------------+------------+-----------+--------+------------+
| 1 | 0000-00-00 | max | | M | 0000-00-00 |
+--------+------------+------------+-----------+--------+------------+
1 row in set (0.00 sec)
MySQL 5.6: Optimizer Features
• Subquery Optimizations
• File Sort optimizations
• Index Condition Pushdown
• Batched Key Access
• Multi Range Read
MySQL 5.6 – Hadoop Applier
17.04.2014 © SkySQL Ab. Commercial in Confidence 20
Questions? Max Mether
@maxmether [email protected]
17.04.2014 © SkySQL Ab. Commercial in Confidence 21