SlideShare a Scribd company logo
1 of 55
Download to read offline
OMG MySQL 8.0 is out! Are
we there yet?
Gabriela Ferrara
@gabidavila
http://gabriela.io/feedback | https://joind.in/talk/2e783
@gabidavila
Gabi


Developer Advocate @ Google
@gabidavila
MySQL 8.0.11
@gabidavila
Are we there yet?
🤔
● Created to handle from up
to 10 to 100M rows or
around 100MB/table
● Now supports terabyte-
sized databases
● Supports SQL standards as
new as SQL 2016
● But... some stuff from SQL
2003 just became available
(Window Functions, CTEs)
● What can we go from here?
@gabidavila
What Happened to 6.0 and 7.0?
@gabidavila
Topics
● New Defaults & Variables
● InnoDB Performance
● Window Functions
● CTE - Common Table Expressions
@gabidavila
New Defaults & Variables
@gabidavila
New default Charset
● Default:
● 5.7: latin1
● 8.0: utf8mb4
● Improvements:
● ➕ Mathematical Equations 𝑒=𝑚·𝑐²
● 😁 🙄 %
● & more SMP (Supplementary Multilingual Plane) Characters
@gabidavila
New default Collation
● utf8mb4_0900_ai_ci
● UTF-8 version 9.0 support
● Accent Insensitive
● Case Insensitive
● No more 🍣 = 🍺 bug
● Caused by utf8mb4_general_ci or utf8mb4_unicode_ci
More information on how collations behave here.
@gabidavila
Other defaults & variables
● Binary log (log_bin) is enabled by default
● SHA-2 for authentication
● Mandatory default value for TIMESTAMP
● New variable to dedicated servers (default OFF),
innodb_dedicated_server=ON , controls dynamically:
● innodb_buffer_pool_size
● innodb_log_file_size
● innodb_flush_method
@gabidavila
InnoDB Performance
@gabidavila
Transaction Scheduling
RDBMS usually works on a FIFO architecture
Transaction A
Transaction B
Transaction C
Start
End
@gabidavila
CATS
First database in the world to
implement
@gabidavila
Contention Aware Transaction Scheduling
@gabidavila
CATS vs FIFO | Transactions per Second (TPS)
0
5500
11000
16500
22000
32 64 128 256 512
FIFO CATS
DataextractedfromMySQLServerTeamwebsite.
Transactions per Second x # Clients
Higher is better
@gabidavila
CATS vs FIFO | Latency
0
45
90
135
180
32 64 128 256 512
FIFO CATS
DataextractedfromMySQLServerTeamwebsite.
Mean Latency x # Clients
Lower is better
@gabidavila
Indexes
@gabidavila
DESCRIBE `lines`;
type null extra
id int(11) NO AUTO_INCREMENT
number int(11) YES
timpestamp_in_ms timestamp YES
character_id int(11) NO
episode_id int(11) NO
location_id int(11) NO
character_line text YES
word_count int(11) YES
@gabidavila
Invisible Indexes
● Not used by the optimizer
● Visible by default, to create an invisible index:
ALTER TABLE lines
ADD INDEX ix_word_count (word_count) INVISIBLE;
ALTER TABLE lines ALTER INDEX ix_word_count INVISIBLE;
ALTER TABLE lines ALTER INDEX ix_word_count VISIBLE;
● Toggle visibility:
@gabidavila
Invisible Indexes
SELECT *
FROM lines
WHERE word_count > 25
ORDER BY word_count DESC;
Invisible
Query cost: 59175.37
Visible
Query cost: 2847.86
@gabidavila
Descending Indexes
Up to 5.7
● Syntax allowed ASC or DESC when defining an index
However...
An index_col_name specification can end with ASC or DESC. These keywords are
permitted for future extensions for specifying ascending or descending index value
storage. Currently, they are parsed but ignored; index values are always stored in
ascending order.
@gabidavila
MySQL 8.0 has it!!!
@gabidavila
Descending Indexes
● No longer ignored and forcibly created as ASC
ALTER TABLE lines
ADD INDEX ix_word_count (word_count DESC);
@gabidavila
Descending Indexes
Can be scanned as intended or backwards
SELECT *
FROM lines
WHERE word_count > 25
ORDER BY word_count DESC;
-- OR WITH THE SAME COST
SELECT *
FROM lines
WHERE word_count > 25
ORDER BY word_count;
@gabidavila
DEMO
@gabidavila
More cool features!
@gabidavila
Window Functions
@gabidavila
What they do?
● Allows to analyze the rows of a given result set
● Can behave like a GROUP BY without changing the result set
● Allows you to use a frame to "peek" OVER a PARTITION of a window
@gabidavila
Window Functions
● Examples:
● Enumerate rows - ROW_NUMBER()
● Show Aggregated sums - SUM()
● Rank results - RANK()
● Look at neighboring rows - LEAD(), LAG()
@gabidavila
DESCRIBE `episodes`;
CREATE TABLE `episodes` (
`id` int(11) NOT NULL,
`title` varchar(255),
`episode_date` date,
`season` int(11),
`number_in_season` int(11),
`number_in_series` int(11),
`million_viewers` decimal(10, 2),
`imdb_rating` decimal(10, 2),
`imdb_votes` decimal(10, 2),
`image_url` text,
`video_url` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
@gabidavila
SELECT … FROM `episodes` LIMIT 10;
+----+--------------+-----------------------------------+--------+------------------+-----------------+
| id | episode_date | title | season | number_in_season | million_viewers |
+----+--------------+-----------------------------------+--------+------------------+-----------------+
| 1 | 1989-12-17 | Simpsons Roasting on an Open Fire | 1 | 1 | 26.70 |
| 2 | 1990-01-14 | Bart the Genius | 1 | 2 | 24.50 |
| 3 | 1990-01-21 | Homer's Odyssey | 1 | 3 | 27.50 |
| 4 | 1990-01-28 | There's No Disgrace Like Home | 1 | 4 | 20.20 |
| 5 | 1990-02-04 | Bart the General | 1 | 5 | 27.10 |
| 6 | 1990-02-11 | Moaning Lisa | 1 | 6 | 27.40 |
| 7 | 1990-02-18 | The Call of the Simpsons | 1 | 7 | 27.60 |
| 8 | 1990-02-25 | The Telltale Head | 1 | 8 | 28.00 |
| 9 | 1990-03-18 | Life on the Fast Lane | 1 | 9 | 33.50 |
| 10 | 1990-03-25 | Homer's Night Out | 1 | 10 | 30.30 |
+----+--------------+-----------------------------------+--------+------------------+-----------------+
10 rows in set (0.00 sec)
@gabidavila
Previous and Next episodes | LAG and LEAD
SELECT
id,
title,
LAG(episode_date, 1) OVER (ORDER BY episode_date) AS previous_episode,
episode_date,
LEAD(episode_date, 1) OVER (ORDER BY episode_date) AS next_episode,
million_viewers
FROM episodes;
@gabidavila
SELECT … FROM `episodes` LIMIT 10;
+----+-----------------------------------+------------------+--------------+--------------+-----------------+
| id | title | previous_episode | episode_date | next_episode | million_viewers |
+----+-----------------------------------+------------------+--------------+--------------+-----------------+
| 1 | Simpsons Roasting on an Open Fire | NULL | 1989-12-17 | 1990-01-14 | 26.70 |
| 2 | Bart the Genius | 1989-12-17 | 1990-01-14 | 1990-01-21 | 24.50 |
| 3 | Homer's Odyssey | 1990-01-14 | 1990-01-21 | 1990-01-28 | 27.50 |
| 4 | There's No Disgrace Like Home | 1990-01-21 | 1990-01-28 | 1990-02-04 | 20.20 |
| 5 | Bart the General | 1990-01-28 | 1990-02-04 | 1990-02-11 | 27.10 |
| 6 | Moaning Lisa | 1990-02-04 | 1990-02-11 | 1990-02-18 | 27.40 |
| 7 | The Call of the Simpsons | 1990-02-11 | 1990-02-18 | 1990-02-25 | 27.60 |
| 8 | The Telltale Head | 1990-02-18 | 1990-02-25 | 1990-03-18 | 28.00 |
| 9 | Life on the Fast Lane | 1990-02-25 | 1990-03-18 | 1990-03-25 | 33.50 |
| 10 | Homer's Night Out | 1990-03-18 | 1990-03-25 | 1990-04-15 | 30.30 |
+----+-----------------------------------+------------------+--------------+--------------+-----------------+
10 rows in set (0.01 sec)
@gabidavila
Break down
LAG(episode_date, 1) OVER (ORDER BY episode_date)
windowfunction
column
# rows preceding
@gabidavila
Repetition?
SELECT
id,
title,
LAG(episode_date, 1) OVER (ORDER BY episode_date) AS previous_episode,
episode_date,
LEAD(episode_date, 1) OVER (ORDER BY episode_date) AS next_episode,
million_viewers
FROM episodes;
@gabidavila
SELECT
id,
title,
LAG(episode_date, 1) OVER (dates) AS previous_episode,
episode_date,
LEAD(episode_date, 1) OVER (dates) AS next_episode,
million_viewers
FROM episodes
WINDOW dates AS (ORDER BY episode_date);
Named Windows!
@gabidavila
DEMO
Rank episodes by million_viewers
@gabidavila
CTE

Common Table Expressions
@gabidavila
Common Table Expressions
● Similar to CREATE [TEMPORARY] TABLE
● Doesn’t need CREATE privilege
● Can reference other CTEs (if those are already defined)
● Can be recursive
● Easier to read
@gabidavila
Rank episodes by million_viewers
SELECT
id,
season,
number_in_season AS '# in season',
title,
episode_date,
million_viewers,
RANK() OVER (season_viewers) AS episode_rank
FROM episodes
WINDOW season_viewers
AS (PARTITION BY season ORDER BY million_viewers DESC)
@gabidavila
DEMO
Filter ranked episodes
@gabidavila
Recursive CTE
● Useful with hierarchical data
● The Recipe is:
● Base query comes first
● Second query comes after a UNION statement
● And the stop condition should be on the recursive call
@gabidavila
DEMO
Fibonacci
@gabidavila
Fibonacci
WITH RECURSIVE fibonacci(recursion_level, fibonacci_number, next_number)
AS (
# Base Case
SELECT 0 AS recursion_level,
0 AS fibonacci_number,
1 AS next_number
UNION ALL
# Recursion query
SELECT recursion_level + 1,
next_number,
fibonacci_number + next_number
FROM fibonacci
# Stopping condition
WHERE
recursion_level < 10
)
SELECT * FROM fibonacci;
@gabidavila
Fibonacci
WITH RECURSIVE fibonacci(recursion_level, fibonacci_number, next_number)
AS (
# Base Case
SELECT 0 AS recursion_level,
0 AS fibonacci_number,
1 AS next_number
UNION ALL
# Recursion query
SELECT recursion_level + 1,
next_number,
fibonacci_number + next_number
FROM fibonacci
# Stopping condition
WHERE
recursion_level < 10
)
SELECT * FROM fibonacci;
@gabidavila
Fibonacci
+-----------------+------------------+-------------+
| recursion_level | fibonacci_number | next_number |
+-----------------+------------------+-------------+
| 0 | 0 | 1 |
| 1 | 1 | 1 |
| 2 | 1 | 2 |
| 3 | 2 | 3 |
| 4 | 3 | 5 |
| 5 | 5 | 8 |
| 6 | 8 | 13 |
| 7 | 13 | 21 |
| 8 | 21 | 34 |
| 9 | 34 | 55 |
| 10 | 55 | 89 |
+-----------------+------------------+-------------+
11 rows in set (0.00 sec)
Base case
Recursive Query
@gabidavila
Data Dictionary and 

Atomic DDL
@gabidavila
Data Dictionary
● No more meta-data on MyISAM tables into the mysql schema
● No more meta-data on files: .FRM, .PAR, .TRG, .TRN
● System tables still exists, but in InnoDB tables
@gabidavila
Data Dictionary
● Accessible through the information_schema:
● implemented as views over Data Dictionary
● uses the optimizer to read the meta-data from the Data Dictionary
● up to 100x faster
@gabidavila
Atomic DDL
● A DDL operation consists of:
● Data Dictionary updates
● Storage Engine Operations
● Binary logs writes
@gabidavila
Atomic DDL
● Either all DDL works or no change is made
● DDL Executed as an internal InnoDB Transactions
● No more crashes when executing DDL in multiple objects (DROP TABLES,
TRUNCATE TABLE)
@gabidavila
Other Bits
@gabidavila
Other MySQL 8.0 Bits
● Data Dictionary
● Users now can have ROLES
● Instantaneously add columns (ALGORITHM=INSTANT)
● CATS instead of FIFO for high concurrency
● JSON partial update
● Better Geospatial support
● Better UUID support
● Use MySQL without SQL (through MySQL Shell or X)
@gabidavila
Questions?
@gabidavila
Thank you!
Please rate my talk!
https://joind.in/talk/2e783 or
gabriela.io/feedback

More Related Content

What's hot

Modern solutions for modern database load: improvements in the latest MariaDB...
Modern solutions for modern database load: improvements in the latest MariaDB...Modern solutions for modern database load: improvements in the latest MariaDB...
Modern solutions for modern database load: improvements in the latest MariaDB...Sveta Smirnova
 
Optimizer Histograms: When they Help and When Do Not?
Optimizer Histograms: When they Help and When Do Not?Optimizer Histograms: When they Help and When Do Not?
Optimizer Histograms: When they Help and When Do Not?Sveta Smirnova
 
Using JSON with MariaDB and MySQL
Using JSON with MariaDB and MySQLUsing JSON with MariaDB and MySQL
Using JSON with MariaDB and MySQLAnders Karlsson
 
BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7Georgi Kodinov
 
Common Table Expressions in MariaDB 10.2
Common Table Expressions in MariaDB 10.2Common Table Expressions in MariaDB 10.2
Common Table Expressions in MariaDB 10.2Sergey Petrunya
 
Billion Goods in Few Categories: how Histograms Save a Life?
Billion Goods in Few Categories: how Histograms Save a Life?Billion Goods in Few Categories: how Histograms Save a Life?
Billion Goods in Few Categories: how Histograms Save a Life?Sveta Smirnova
 
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitMySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitDave Stokes
 
Introduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]sIntroduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]sSveta Smirnova
 
Advanced MySQL Query Tuning
Advanced MySQL Query TuningAdvanced MySQL Query Tuning
Advanced MySQL Query TuningAlexander Rubin
 
Cassandra nice use cases and worst anti patterns no sql-matters barcelona
Cassandra nice use cases and worst anti patterns no sql-matters barcelonaCassandra nice use cases and worst anti patterns no sql-matters barcelona
Cassandra nice use cases and worst anti patterns no sql-matters barcelonaDuyhai Doan
 
Cassandra Materialized Views
Cassandra Materialized ViewsCassandra Materialized Views
Cassandra Materialized ViewsCarl Yeksigian
 
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...Sveta Smirnova
 
The world's next top data model
The world's next top data modelThe world's next top data model
The world's next top data modelPatrick McFadin
 
Cassandra 3 new features 2016
Cassandra 3 new features 2016Cassandra 3 new features 2016
Cassandra 3 new features 2016Duyhai Doan
 
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013Jaime Crespo
 
Standard SQL features where PostgreSQL beats its competitors
Standard SQL features where PostgreSQL beats its competitorsStandard SQL features where PostgreSQL beats its competitors
Standard SQL features where PostgreSQL beats its competitorsMarkus Winand
 

What's hot (20)

Modern solutions for modern database load: improvements in the latest MariaDB...
Modern solutions for modern database load: improvements in the latest MariaDB...Modern solutions for modern database load: improvements in the latest MariaDB...
Modern solutions for modern database load: improvements in the latest MariaDB...
 
Optimizer Histograms: When they Help and When Do Not?
Optimizer Histograms: When they Help and When Do Not?Optimizer Histograms: When they Help and When Do Not?
Optimizer Histograms: When they Help and When Do Not?
 
Using JSON with MariaDB and MySQL
Using JSON with MariaDB and MySQLUsing JSON with MariaDB and MySQL
Using JSON with MariaDB and MySQL
 
BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7
 
Common Table Expressions in MariaDB 10.2
Common Table Expressions in MariaDB 10.2Common Table Expressions in MariaDB 10.2
Common Table Expressions in MariaDB 10.2
 
Billion Goods in Few Categories: how Histograms Save a Life?
Billion Goods in Few Categories: how Histograms Save a Life?Billion Goods in Few Categories: how Histograms Save a Life?
Billion Goods in Few Categories: how Histograms Save a Life?
 
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source SummitMySQL 8.0 New Features -- September 27th presentation for Open Source Summit
MySQL 8.0 New Features -- September 27th presentation for Open Source Summit
 
Mentor Your Indexes
Mentor Your IndexesMentor Your Indexes
Mentor Your Indexes
 
Introduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]sIntroduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]s
 
Advanced MySQL Query Tuning
Advanced MySQL Query TuningAdvanced MySQL Query Tuning
Advanced MySQL Query Tuning
 
Sql query patterns, optimized
Sql query patterns, optimizedSql query patterns, optimized
Sql query patterns, optimized
 
Cassandra nice use cases and worst anti patterns no sql-matters barcelona
Cassandra nice use cases and worst anti patterns no sql-matters barcelonaCassandra nice use cases and worst anti patterns no sql-matters barcelona
Cassandra nice use cases and worst anti patterns no sql-matters barcelona
 
Linq
LinqLinq
Linq
 
Load Data Fast!
Load Data Fast!Load Data Fast!
Load Data Fast!
 
Cassandra Materialized Views
Cassandra Materialized ViewsCassandra Materialized Views
Cassandra Materialized Views
 
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
 
The world's next top data model
The world's next top data modelThe world's next top data model
The world's next top data model
 
Cassandra 3 new features 2016
Cassandra 3 new features 2016Cassandra 3 new features 2016
Cassandra 3 new features 2016
 
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
 
Standard SQL features where PostgreSQL beats its competitors
Standard SQL features where PostgreSQL beats its competitorsStandard SQL features where PostgreSQL beats its competitors
Standard SQL features where PostgreSQL beats its competitors
 

Similar to DPC18 - OMG MySQL 8.0 is out! are we there yet?

GRONINGEN PHP - MySQL 8.0 , not only good, great
GRONINGEN PHP - MySQL 8.0 , not only good, greatGRONINGEN PHP - MySQL 8.0 , not only good, great
GRONINGEN PHP - MySQL 8.0 , not only good, greatGabriela Ferrara
 
介绍 Percona 服务器 XtraDB 和 Xtrabackup
介绍 Percona 服务器 XtraDB 和 Xtrabackup介绍 Percona 服务器 XtraDB 和 Xtrabackup
介绍 Percona 服务器 XtraDB 和 XtrabackupYUCHENG HU
 
How Database Convergence Impacts the Coming Decades of Data Management
How Database Convergence Impacts the Coming Decades of Data ManagementHow Database Convergence Impacts the Coming Decades of Data Management
How Database Convergence Impacts the Coming Decades of Data ManagementSingleStore
 
MySQL 8.0 Preview: What Is Coming?
MySQL 8.0 Preview: What Is Coming?MySQL 8.0 Preview: What Is Coming?
MySQL 8.0 Preview: What Is Coming?Gabriela Ferrara
 
Developers’ mDay u Banjoj Luci - Bogdan Kecman, Oracle – MySQL Server 8.0
Developers’ mDay u Banjoj Luci - Bogdan Kecman, Oracle – MySQL Server 8.0Developers’ mDay u Banjoj Luci - Bogdan Kecman, Oracle – MySQL Server 8.0
Developers’ mDay u Banjoj Luci - Bogdan Kecman, Oracle – MySQL Server 8.0mCloud
 
Developers' mDay 2017. - Bogdan Kecman Oracle
Developers' mDay 2017. - Bogdan Kecman OracleDevelopers' mDay 2017. - Bogdan Kecman Oracle
Developers' mDay 2017. - Bogdan Kecman OraclemCloud
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8Frederic Descamps
 
Advanced MariaDB features that developers love.pdf
Advanced MariaDB features that developers love.pdfAdvanced MariaDB features that developers love.pdf
Advanced MariaDB features that developers love.pdfFederico Razzoli
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeWim Godden
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeWim Godden
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesInMobi Technology
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeWim Godden
 
PHPDay 2019 - MySQL 8, not only good, great!
PHPDay 2019 - MySQL 8, not only good, great!PHPDay 2019 - MySQL 8, not only good, great!
PHPDay 2019 - MySQL 8, not only good, great!Gabriela Ferrara
 
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server MariaDB plc
 
Big Data Analytics with MariaDB ColumnStore
Big Data Analytics with MariaDB ColumnStoreBig Data Analytics with MariaDB ColumnStore
Big Data Analytics with MariaDB ColumnStoreMariaDB plc
 
SDPHP - Percona Toolkit (It's Basically Magic)
SDPHP - Percona Toolkit (It's Basically Magic)SDPHP - Percona Toolkit (It's Basically Magic)
SDPHP - Percona Toolkit (It's Basically Magic)Robert Swisher
 
MariaDB 10.2 New Features
MariaDB 10.2 New FeaturesMariaDB 10.2 New Features
MariaDB 10.2 New FeaturesFromDual GmbH
 
MySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features SummaryMySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features SummaryOlivier DASINI
 
2012 09 MariaDB Boston Meetup - MariaDB 是 Mysql 的替代者吗
2012 09 MariaDB Boston Meetup - MariaDB 是 Mysql 的替代者吗2012 09 MariaDB Boston Meetup - MariaDB 是 Mysql 的替代者吗
2012 09 MariaDB Boston Meetup - MariaDB 是 Mysql 的替代者吗YUCHENG HU
 

Similar to DPC18 - OMG MySQL 8.0 is out! are we there yet? (20)

GRONINGEN PHP - MySQL 8.0 , not only good, great
GRONINGEN PHP - MySQL 8.0 , not only good, greatGRONINGEN PHP - MySQL 8.0 , not only good, great
GRONINGEN PHP - MySQL 8.0 , not only good, great
 
介绍 Percona 服务器 XtraDB 和 Xtrabackup
介绍 Percona 服务器 XtraDB 和 Xtrabackup介绍 Percona 服务器 XtraDB 和 Xtrabackup
介绍 Percona 服务器 XtraDB 和 Xtrabackup
 
MySQLinsanity
MySQLinsanityMySQLinsanity
MySQLinsanity
 
How Database Convergence Impacts the Coming Decades of Data Management
How Database Convergence Impacts the Coming Decades of Data ManagementHow Database Convergence Impacts the Coming Decades of Data Management
How Database Convergence Impacts the Coming Decades of Data Management
 
MySQL 8.0 Preview: What Is Coming?
MySQL 8.0 Preview: What Is Coming?MySQL 8.0 Preview: What Is Coming?
MySQL 8.0 Preview: What Is Coming?
 
Developers’ mDay u Banjoj Luci - Bogdan Kecman, Oracle – MySQL Server 8.0
Developers’ mDay u Banjoj Luci - Bogdan Kecman, Oracle – MySQL Server 8.0Developers’ mDay u Banjoj Luci - Bogdan Kecman, Oracle – MySQL Server 8.0
Developers’ mDay u Banjoj Luci - Bogdan Kecman, Oracle – MySQL Server 8.0
 
Developers' mDay 2017. - Bogdan Kecman Oracle
Developers' mDay 2017. - Bogdan Kecman OracleDevelopers' mDay 2017. - Bogdan Kecman Oracle
Developers' mDay 2017. - Bogdan Kecman Oracle
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8
 
Advanced MariaDB features that developers love.pdf
Advanced MariaDB features that developers love.pdfAdvanced MariaDB features that developers love.pdf
Advanced MariaDB features that developers love.pdf
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major Features
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
PHPDay 2019 - MySQL 8, not only good, great!
PHPDay 2019 - MySQL 8, not only good, great!PHPDay 2019 - MySQL 8, not only good, great!
PHPDay 2019 - MySQL 8, not only good, great!
 
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
MariaDB Tech und Business Update Hamburg 2023 - MariaDB Enterprise Server
 
Big Data Analytics with MariaDB ColumnStore
Big Data Analytics with MariaDB ColumnStoreBig Data Analytics with MariaDB ColumnStore
Big Data Analytics with MariaDB ColumnStore
 
SDPHP - Percona Toolkit (It's Basically Magic)
SDPHP - Percona Toolkit (It's Basically Magic)SDPHP - Percona Toolkit (It's Basically Magic)
SDPHP - Percona Toolkit (It's Basically Magic)
 
MariaDB 10.2 New Features
MariaDB 10.2 New FeaturesMariaDB 10.2 New Features
MariaDB 10.2 New Features
 
MySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features SummaryMySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features Summary
 
2012 09 MariaDB Boston Meetup - MariaDB 是 Mysql 的替代者吗
2012 09 MariaDB Boston Meetup - MariaDB 是 Mysql 的替代者吗2012 09 MariaDB Boston Meetup - MariaDB 是 Mysql 的替代者吗
2012 09 MariaDB Boston Meetup - MariaDB 是 Mysql 的替代者吗
 

More from Gabriela Ferrara

Serverless and you @ Women Who Code London 2020
Serverless and you  @ Women Who Code London 2020Serverless and you  @ Women Who Code London 2020
Serverless and you @ Women Who Code London 2020Gabriela Ferrara
 
Serverless and you - where do i run my stateless code
Serverless and you  - where do i run my stateless codeServerless and you  - where do i run my stateless code
Serverless and you - where do i run my stateless codeGabriela Ferrara
 
PyTexas - Machine learning APIs by Example
PyTexas - Machine learning APIs by ExamplePyTexas - Machine learning APIs by Example
PyTexas - Machine learning APIs by ExampleGabriela Ferrara
 
LaravelSP - MySQL 5.7: introdução ao JSON Data Type
LaravelSP - MySQL 5.7: introdução ao JSON Data TypeLaravelSP - MySQL 5.7: introdução ao JSON Data Type
LaravelSP - MySQL 5.7: introdução ao JSON Data TypeGabriela Ferrara
 
SunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLSunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLGabriela Ferrara
 
MySQL 5.7 - 
Tirando o Máximo Proveito
MySQL 5.7 - 
Tirando o Máximo ProveitoMySQL 5.7 - 
Tirando o Máximo Proveito
MySQL 5.7 - 
Tirando o Máximo ProveitoGabriela Ferrara
 
Strip your TEXT fields - Exeter Web Feb/2016
Strip your TEXT fields - Exeter Web Feb/2016Strip your TEXT fields - Exeter Web Feb/2016
Strip your TEXT fields - Exeter Web Feb/2016Gabriela Ferrara
 
Coding like a girl - DjangoCon
Coding like a girl - DjangoConCoding like a girl - DjangoCon
Coding like a girl - DjangoConGabriela Ferrara
 
LAMP: Desenvolvendo além do trivial
LAMP: Desenvolvendo além do trivialLAMP: Desenvolvendo além do trivial
LAMP: Desenvolvendo além do trivialGabriela Ferrara
 
Database Wizardry for Legacy Applications
Database Wizardry for Legacy ApplicationsDatabase Wizardry for Legacy Applications
Database Wizardry for Legacy ApplicationsGabriela Ferrara
 
Coding like a girl - Youtube presentation
Coding like a girl - Youtube presentationCoding like a girl - Youtube presentation
Coding like a girl - Youtube presentationGabriela Ferrara
 

More from Gabriela Ferrara (13)

Serverless and you @ Women Who Code London 2020
Serverless and you  @ Women Who Code London 2020Serverless and you  @ Women Who Code London 2020
Serverless and you @ Women Who Code London 2020
 
Serverless and you - where do i run my stateless code
Serverless and you  - where do i run my stateless codeServerless and you  - where do i run my stateless code
Serverless and you - where do i run my stateless code
 
PyTexas - Machine learning APIs by Example
PyTexas - Machine learning APIs by ExamplePyTexas - Machine learning APIs by Example
PyTexas - Machine learning APIs by Example
 
LaravelSP - MySQL 5.7: introdução ao JSON Data Type
LaravelSP - MySQL 5.7: introdução ao JSON Data TypeLaravelSP - MySQL 5.7: introdução ao JSON Data Type
LaravelSP - MySQL 5.7: introdução ao JSON Data Type
 
SunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLSunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQL
 
MySQL 5.7 - 
Tirando o Máximo Proveito
MySQL 5.7 - 
Tirando o Máximo ProveitoMySQL 5.7 - 
Tirando o Máximo Proveito
MySQL 5.7 - 
Tirando o Máximo Proveito
 
Strip your TEXT fields - Exeter Web Feb/2016
Strip your TEXT fields - Exeter Web Feb/2016Strip your TEXT fields - Exeter Web Feb/2016
Strip your TEXT fields - Exeter Web Feb/2016
 
Strip your TEXT fields
Strip your TEXT fieldsStrip your TEXT fields
Strip your TEXT fields
 
Coding like a girl - DjangoCon
Coding like a girl - DjangoConCoding like a girl - DjangoCon
Coding like a girl - DjangoCon
 
LAMP: Desenvolvendo além do trivial
LAMP: Desenvolvendo além do trivialLAMP: Desenvolvendo além do trivial
LAMP: Desenvolvendo além do trivial
 
Database Wizardry for Legacy Applications
Database Wizardry for Legacy ApplicationsDatabase Wizardry for Legacy Applications
Database Wizardry for Legacy Applications
 
Coding like a girl - Youtube presentation
Coding like a girl - Youtube presentationCoding like a girl - Youtube presentation
Coding like a girl - Youtube presentation
 
Coding like a Girl
Coding like a GirlCoding like a Girl
Coding like a Girl
 

Recently uploaded

%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 

Recently uploaded (20)

%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

DPC18 - OMG MySQL 8.0 is out! are we there yet?

  • 1. OMG MySQL 8.0 is out! Are we there yet? Gabriela Ferrara @gabidavila http://gabriela.io/feedback | https://joind.in/talk/2e783
  • 4. @gabidavila Are we there yet? 🤔 ● Created to handle from up to 10 to 100M rows or around 100MB/table ● Now supports terabyte- sized databases ● Supports SQL standards as new as SQL 2016 ● But... some stuff from SQL 2003 just became available (Window Functions, CTEs) ● What can we go from here?
  • 6. @gabidavila Topics ● New Defaults & Variables ● InnoDB Performance ● Window Functions ● CTE - Common Table Expressions
  • 8. @gabidavila New default Charset ● Default: ● 5.7: latin1 ● 8.0: utf8mb4 ● Improvements: ● ➕ Mathematical Equations 𝑒=𝑚·𝑐² ● 😁 🙄 % ● & more SMP (Supplementary Multilingual Plane) Characters
  • 9. @gabidavila New default Collation ● utf8mb4_0900_ai_ci ● UTF-8 version 9.0 support ● Accent Insensitive ● Case Insensitive ● No more 🍣 = 🍺 bug ● Caused by utf8mb4_general_ci or utf8mb4_unicode_ci More information on how collations behave here.
  • 10. @gabidavila Other defaults & variables ● Binary log (log_bin) is enabled by default ● SHA-2 for authentication ● Mandatory default value for TIMESTAMP ● New variable to dedicated servers (default OFF), innodb_dedicated_server=ON , controls dynamically: ● innodb_buffer_pool_size ● innodb_log_file_size ● innodb_flush_method
  • 12. @gabidavila Transaction Scheduling RDBMS usually works on a FIFO architecture Transaction A Transaction B Transaction C Start End
  • 13. @gabidavila CATS First database in the world to implement
  • 15. @gabidavila CATS vs FIFO | Transactions per Second (TPS) 0 5500 11000 16500 22000 32 64 128 256 512 FIFO CATS DataextractedfromMySQLServerTeamwebsite. Transactions per Second x # Clients Higher is better
  • 16. @gabidavila CATS vs FIFO | Latency 0 45 90 135 180 32 64 128 256 512 FIFO CATS DataextractedfromMySQLServerTeamwebsite. Mean Latency x # Clients Lower is better
  • 18. @gabidavila DESCRIBE `lines`; type null extra id int(11) NO AUTO_INCREMENT number int(11) YES timpestamp_in_ms timestamp YES character_id int(11) NO episode_id int(11) NO location_id int(11) NO character_line text YES word_count int(11) YES
  • 19. @gabidavila Invisible Indexes ● Not used by the optimizer ● Visible by default, to create an invisible index: ALTER TABLE lines ADD INDEX ix_word_count (word_count) INVISIBLE; ALTER TABLE lines ALTER INDEX ix_word_count INVISIBLE; ALTER TABLE lines ALTER INDEX ix_word_count VISIBLE; ● Toggle visibility:
  • 20. @gabidavila Invisible Indexes SELECT * FROM lines WHERE word_count > 25 ORDER BY word_count DESC; Invisible Query cost: 59175.37 Visible Query cost: 2847.86
  • 21. @gabidavila Descending Indexes Up to 5.7 ● Syntax allowed ASC or DESC when defining an index However... An index_col_name specification can end with ASC or DESC. These keywords are permitted for future extensions for specifying ascending or descending index value storage. Currently, they are parsed but ignored; index values are always stored in ascending order.
  • 23. @gabidavila Descending Indexes ● No longer ignored and forcibly created as ASC ALTER TABLE lines ADD INDEX ix_word_count (word_count DESC);
  • 24. @gabidavila Descending Indexes Can be scanned as intended or backwards SELECT * FROM lines WHERE word_count > 25 ORDER BY word_count DESC; -- OR WITH THE SAME COST SELECT * FROM lines WHERE word_count > 25 ORDER BY word_count;
  • 28. @gabidavila What they do? ● Allows to analyze the rows of a given result set ● Can behave like a GROUP BY without changing the result set ● Allows you to use a frame to "peek" OVER a PARTITION of a window
  • 29. @gabidavila Window Functions ● Examples: ● Enumerate rows - ROW_NUMBER() ● Show Aggregated sums - SUM() ● Rank results - RANK() ● Look at neighboring rows - LEAD(), LAG()
  • 30. @gabidavila DESCRIBE `episodes`; CREATE TABLE `episodes` ( `id` int(11) NOT NULL, `title` varchar(255), `episode_date` date, `season` int(11), `number_in_season` int(11), `number_in_series` int(11), `million_viewers` decimal(10, 2), `imdb_rating` decimal(10, 2), `imdb_votes` decimal(10, 2), `image_url` text, `video_url` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  • 31. @gabidavila SELECT … FROM `episodes` LIMIT 10; +----+--------------+-----------------------------------+--------+------------------+-----------------+ | id | episode_date | title | season | number_in_season | million_viewers | +----+--------------+-----------------------------------+--------+------------------+-----------------+ | 1 | 1989-12-17 | Simpsons Roasting on an Open Fire | 1 | 1 | 26.70 | | 2 | 1990-01-14 | Bart the Genius | 1 | 2 | 24.50 | | 3 | 1990-01-21 | Homer's Odyssey | 1 | 3 | 27.50 | | 4 | 1990-01-28 | There's No Disgrace Like Home | 1 | 4 | 20.20 | | 5 | 1990-02-04 | Bart the General | 1 | 5 | 27.10 | | 6 | 1990-02-11 | Moaning Lisa | 1 | 6 | 27.40 | | 7 | 1990-02-18 | The Call of the Simpsons | 1 | 7 | 27.60 | | 8 | 1990-02-25 | The Telltale Head | 1 | 8 | 28.00 | | 9 | 1990-03-18 | Life on the Fast Lane | 1 | 9 | 33.50 | | 10 | 1990-03-25 | Homer's Night Out | 1 | 10 | 30.30 | +----+--------------+-----------------------------------+--------+------------------+-----------------+ 10 rows in set (0.00 sec)
  • 32. @gabidavila Previous and Next episodes | LAG and LEAD SELECT id, title, LAG(episode_date, 1) OVER (ORDER BY episode_date) AS previous_episode, episode_date, LEAD(episode_date, 1) OVER (ORDER BY episode_date) AS next_episode, million_viewers FROM episodes;
  • 33. @gabidavila SELECT … FROM `episodes` LIMIT 10; +----+-----------------------------------+------------------+--------------+--------------+-----------------+ | id | title | previous_episode | episode_date | next_episode | million_viewers | +----+-----------------------------------+------------------+--------------+--------------+-----------------+ | 1 | Simpsons Roasting on an Open Fire | NULL | 1989-12-17 | 1990-01-14 | 26.70 | | 2 | Bart the Genius | 1989-12-17 | 1990-01-14 | 1990-01-21 | 24.50 | | 3 | Homer's Odyssey | 1990-01-14 | 1990-01-21 | 1990-01-28 | 27.50 | | 4 | There's No Disgrace Like Home | 1990-01-21 | 1990-01-28 | 1990-02-04 | 20.20 | | 5 | Bart the General | 1990-01-28 | 1990-02-04 | 1990-02-11 | 27.10 | | 6 | Moaning Lisa | 1990-02-04 | 1990-02-11 | 1990-02-18 | 27.40 | | 7 | The Call of the Simpsons | 1990-02-11 | 1990-02-18 | 1990-02-25 | 27.60 | | 8 | The Telltale Head | 1990-02-18 | 1990-02-25 | 1990-03-18 | 28.00 | | 9 | Life on the Fast Lane | 1990-02-25 | 1990-03-18 | 1990-03-25 | 33.50 | | 10 | Homer's Night Out | 1990-03-18 | 1990-03-25 | 1990-04-15 | 30.30 | +----+-----------------------------------+------------------+--------------+--------------+-----------------+ 10 rows in set (0.01 sec)
  • 34. @gabidavila Break down LAG(episode_date, 1) OVER (ORDER BY episode_date) windowfunction column # rows preceding
  • 35. @gabidavila Repetition? SELECT id, title, LAG(episode_date, 1) OVER (ORDER BY episode_date) AS previous_episode, episode_date, LEAD(episode_date, 1) OVER (ORDER BY episode_date) AS next_episode, million_viewers FROM episodes;
  • 36. @gabidavila SELECT id, title, LAG(episode_date, 1) OVER (dates) AS previous_episode, episode_date, LEAD(episode_date, 1) OVER (dates) AS next_episode, million_viewers FROM episodes WINDOW dates AS (ORDER BY episode_date); Named Windows!
  • 39. @gabidavila Common Table Expressions ● Similar to CREATE [TEMPORARY] TABLE ● Doesn’t need CREATE privilege ● Can reference other CTEs (if those are already defined) ● Can be recursive ● Easier to read
  • 40. @gabidavila Rank episodes by million_viewers SELECT id, season, number_in_season AS '# in season', title, episode_date, million_viewers, RANK() OVER (season_viewers) AS episode_rank FROM episodes WINDOW season_viewers AS (PARTITION BY season ORDER BY million_viewers DESC)
  • 42. @gabidavila Recursive CTE ● Useful with hierarchical data ● The Recipe is: ● Base query comes first ● Second query comes after a UNION statement ● And the stop condition should be on the recursive call
  • 44. @gabidavila Fibonacci WITH RECURSIVE fibonacci(recursion_level, fibonacci_number, next_number) AS ( # Base Case SELECT 0 AS recursion_level, 0 AS fibonacci_number, 1 AS next_number UNION ALL # Recursion query SELECT recursion_level + 1, next_number, fibonacci_number + next_number FROM fibonacci # Stopping condition WHERE recursion_level < 10 ) SELECT * FROM fibonacci;
  • 45. @gabidavila Fibonacci WITH RECURSIVE fibonacci(recursion_level, fibonacci_number, next_number) AS ( # Base Case SELECT 0 AS recursion_level, 0 AS fibonacci_number, 1 AS next_number UNION ALL # Recursion query SELECT recursion_level + 1, next_number, fibonacci_number + next_number FROM fibonacci # Stopping condition WHERE recursion_level < 10 ) SELECT * FROM fibonacci;
  • 46. @gabidavila Fibonacci +-----------------+------------------+-------------+ | recursion_level | fibonacci_number | next_number | +-----------------+------------------+-------------+ | 0 | 0 | 1 | | 1 | 1 | 1 | | 2 | 1 | 2 | | 3 | 2 | 3 | | 4 | 3 | 5 | | 5 | 5 | 8 | | 6 | 8 | 13 | | 7 | 13 | 21 | | 8 | 21 | 34 | | 9 | 34 | 55 | | 10 | 55 | 89 | +-----------------+------------------+-------------+ 11 rows in set (0.00 sec) Base case Recursive Query
  • 48. @gabidavila Data Dictionary ● No more meta-data on MyISAM tables into the mysql schema ● No more meta-data on files: .FRM, .PAR, .TRG, .TRN ● System tables still exists, but in InnoDB tables
  • 49. @gabidavila Data Dictionary ● Accessible through the information_schema: ● implemented as views over Data Dictionary ● uses the optimizer to read the meta-data from the Data Dictionary ● up to 100x faster
  • 50. @gabidavila Atomic DDL ● A DDL operation consists of: ● Data Dictionary updates ● Storage Engine Operations ● Binary logs writes
  • 51. @gabidavila Atomic DDL ● Either all DDL works or no change is made ● DDL Executed as an internal InnoDB Transactions ● No more crashes when executing DDL in multiple objects (DROP TABLES, TRUNCATE TABLE)
  • 53. @gabidavila Other MySQL 8.0 Bits ● Data Dictionary ● Users now can have ROLES ● Instantaneously add columns (ALGORITHM=INSTANT) ● CATS instead of FIFO for high concurrency ● JSON partial update ● Better Geospatial support ● Better UUID support ● Use MySQL without SQL (through MySQL Shell or X)
  • 55. @gabidavila Thank you! Please rate my talk! https://joind.in/talk/2e783 or gabriela.io/feedback