Weitere ähnliche Inhalte
Ähnlich wie What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016
Ähnlich wie What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016 (20)
Kürzlich hochgeladen (20)
What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016
- 1. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Improve
Performance
by
3x
with
MySQL
5.7
Geir
Høydalsvik
Sr.
Director
Engineering
Oracle
MySQL,
Engineering
March/April,
2016
Please
Stand
By.
This
session
will
begin
promptly
at
the
time
indicated
on
the
agenda.
Thank
You.
- 2. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Safe
Harbor
Statement
The
following
is
intended
to
outline
our
general
product
direction.
It
is
intended
for
information
purposes
only,
and
may
not
be
incorporated
into
any
contract.
It
is
not
a
commitment
to
deliver
any
material,
code,
or
functionality,
and
should
not
be
relied
upon
in
making
purchasing
decisions.
The
development,
release,
and
timing
of
any
features
or
functionality
described
for
Oracle’s
products
remains
at
the
sole
discretion
of
Oracle.
2
- 3. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
MySQL
5.7
newly
GA
– Oct
2015!
Enhanced
InnoDB:
faster
online
&
bulk
load
operations
Replication
Improvements
(incl.
multi-‐
source,
multi-‐threaded
slaves...)
New
Optimizer
Cost
Model:
greater
user
control
&
better
query
performance
Performance
Schema
Improvements
MySQL
SYS
Schema
Performance
&
Scalability Manageability
3
X
Faster
than
MySQL
5.6
Improved
Security:
safer
initialization,
setup
&
management
Native
JSON
Support
And
many
more
new
features
and
enhancements.
Learn
more
at:
dev.mysql.com
3
- 4. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Benefit
Highlights
of
MySQL
5.7
• Faster
– Server
– quicker
queries,
more
IO,
more
connections
• InnoDB
engine,
Faster
Connect/Disconnect,
More
Optimized
Queries
• No
need
to
use
MyISAM
– can
have
speed
and
consistency
both
now
– Replication
– scales
higher,
faster
slave
processing
• Parallel
replications
(parallel
replication)
– 10x
faster
– GIS
searching
– quickly
search
geographic
data
• Native
InnoDB
Spatial
indexes
– Compression
• Leverages
new
advanced
Operating
File
System
capabilities
• Improves
performance,
saves
space
Oracle
Confidential
– Internal/Restricted/H ighly
Restricted 4
- 5. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Benefit
Highlights
of
MySQL
5.7
(con’t)
Easier
• Easier
Configurability
– dynamic
“online”
changes
• More
Flexible
– Native
JSON
support
– datatype,
binary
storage
format
– Virtual
Columns/Functional
indexes
– index
any
data
and
find
quickly
• Simpler
to
Manage
– More
instruments,
Easy
access
to
data
using
SYS
schema
• More
Secure
– By
default
and
more
options
to
secure
the
server
5
- 6. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
MySQL
5.7
Sysbench
Benchmark:
SQL Point
Selects
3x
Faster
than
MySQL
5.6
1,600,000
QPS
0
500,000
1,000,000
1,500,000
2,000,000
8 16 32 64 128 256 512 1,024
Queries
per
Second
Connections
MySQL
5.7:
Sysbench OLTP
Read
Only
(SQL
Point
Selects)
MySQL
5.7
MySQL
5.6
MySQL
5.5
Intel(R)
Xeon(R)
CPU
E7-‐8890
v3
4
sockets
x
18
cores-‐HT
(144
CPU
threads)
2.5
Ghz,
512GB
RAM
Linux
kernel
3.16
6
- 7. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
MySQL
5.7:
Connections
per
Second
1.7x
Faster
than
MySQL
5.6
3x
Faster
than
MySQL
5.5
100,000
Connections/Sec
0
20,000
40,000
60,000
80,000
100,000
120,000
MySQL
5.5 MySQL
5.6 MySQL
5.7
Connections
/
Second
Intel(R)
Xeon(R)
CPU
E7-‐8890
v3
4
sockets
x
18
cores-‐HT
(144
CPU
threads)
2.5
Ghz,
512GB
RAM
Linux
kernel
3.16
- 8. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
MySQL
5.7
Sysbench
Benchmark:
Mixed
OLTP
Read
Only
3x
Faster
than
MySQL
5.6
6x
Faster
than
MySQL
5.5
0
200,000
400,000
600,000
800,000
1,000,000
1,200,000
8 16 32 64 128 256 512 1,024
Queries
per
Second
Connections
MySQL
5.7:
Sysbench OLTP
Read
Only
(Mixed)
MySQL
5.7
MySQL
5.6
MySQL
5.5
Intel(R)
Xeon(R)
CPU
E7-‐8890
v3
4
sockets
x
18
cores-‐HT
(144
CPU
threads)
2.5
Ghz,
512GB
RAM
Linux
kernel
3.16
Near
1M
QPS
8
- 9. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
MySQL
5.7
Sysbench
Benchmark:
Complex
OLTP
Read
Write
1.5x
Faster
than
MySQL
5.6
3x
Faster
than
MySQL
5.5
0
200,000
400,000
600,000
800,000
8 16 32 64 128 256 512 1,024
Queries
per
Second
Connections
MySQL
5.7:
Sysbench OLTP
Read
Write
(Complex)
MySQL
5.7
MySQL
5.6
MySQL
5.5
Intel(R)
Xeon(R)
CPU
E7-‐8890
v3
4
sockets
x
18
cores-‐HT
(144
CPU
threads)
2.5
Ghz,
512GB
RAM
Linux
kernel
3.16
9
- 10. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
New! MySQL
Router
• Intelligently
routes
MySQL
connections
&
transactions
for
increased
performance
&
uptime
(load
balancing,
failover...etc),
so
you
can
focus
on
application
development
• Provides
cross-‐language
support
for
MySQL
Fabric,
delivering
High
Availability
and
Scalability
through
automated
data
sharding
Easier,
Faster
and
Safer
to
Scale
MySQL
Applications
10
- 11. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
• GTID
enhancements
– On-‐line,
phased
deployment
of
GTIDs
– Binary
logging
on
slave
now
optional
• Enhanced
Semi-‐synchronous
replication
– Write
guaranteed
to
be
received
by
slave
before
being
observed
by
clients
of
the
master
– Option
to
wait
on
Acks
from
multiple
slaves
• Multi-‐Source
Replication
– Consolidate
updates
from
multiple
Masters
into
one
Slave
• Dynamic
slave
filters
• 8-‐10x Faster
slave
throughput
– Often
removes
slave
as
a
bottleneck;
keep
pace
with
master
with
8+
slave
threads
– Option
to
preserve
Commit
order
– Automatic
slave
transaction
retries
MySQL
5.7:
Replication
Improvements
11
0%#
50%#
100%#
150%#
200%#
250%#
1# 8# 24# 48#
Slave#Threads#
Slave#throughput#vs.#96#Thread#Master#
- 12. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Improved
Applier
Throughput
– Locking-‐based
Parallelism
Wednesday,
September
23,
2015
Insert...
Insert...
B
binary
log
Insert...
relay
log
Insert...
A
binary
log
Client
Sender
thread
Receiver
thread
Applier
Threads
Receiver
Meta-‐data
Update
Applier
Meta-‐data
Update
Network
Percona
Live
-‐ Amsterdam
12
- 13. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Improved
Applier
Throughput
– Locking-‐based
Parallelism
Wednesday,
September
23,
2015
Single Threaded Apply 8 Threads Applier 24 Threads Applier 48 Threads Applier 96 Threads Applier
0%
50%
100%
150%
200%
250%
Fast and Scalable Multi-threaded Replication Applier
(statement-based replication, durable settings, SSD storage)
Slave apply time
(Sysbench RW on the master with 96 threads = 100%)
10X
Percona
Live
-‐ Amsterdam
13
- 14. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Core
New
JSON
features
in
MySQL
5.7
• Native
JSON
datatype
• JSON
Functions
• Generated
Columns
14
- 15. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
The
JSON
Type
CREATE TABLE employees (data JSON);
INSERT INTO employees VALUES ('{"id": 1, "name": "Jane"}');
INSERT INTO employees VALUES ('{"id": 2, "name": "Joe"}');
SELECT * FROM employees;
+---------------------------+
| data |
+---------------------------+
| {"id": 1, "name": "Jane"} |
| {"id": 2, "name": "Joe"} |
+---------------------------+
2 rows in set (0,00 sec)
15
- 16. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
Type
Tech
Specs
• utf8mb4
character
set
• Optimized
for
read
intensive
workload
• Parse
and
validation
on
insert
only
• Dictionary
• Sorted
objects'
keys
• Fast
access
to
array
cells
by
index
16
- 17. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
Type
Tech
Specs
(cont.)
• Supports
all
native
JSON
types
• Numbers,
strings,
bool
• Objects,
arrays
• Extended
• Date,
time,
datetime,
timestamp
• Other
17
- 18. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Advantages
over
TEXT/VARCHAR
1. Provides
Document
Validation:
2. Efficient
Binary
Format
Allows
quicker
access
to
object
members
and
array
elements
INSERT INTO employees VALUES ('some random text');
ERROR 3130 (22032): Invalid JSON text: "Expect a value here." at
position 0 in value (or column) 'some random text'.
18
- 19. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
Functions
SET @document = '[10, 20, [30, 40]]';
SELECT JSON_EXTRACT(@document, '$[1]');
+---------------------------------+
| JSON_EXTRACT(@document, '$[1]') |
+---------------------------------+
| 20 |
+---------------------------------+
1 row in set (0.01 sec)
19
- 20. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
• Accepts
a
JSON
Path,
which
is
similar
to
a
selector:
• JSON_EXTRACT
also
supports
a
short
hand:
column_name->"$.type"
JSON_EXTRACT
20
$("#type")
JSON_EXTRACT(column_name, "$.type")
- 21. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Using
Real
Life
Data
• Via
SF
OpenData
• 206K
JSON
objects
representing
subdivision
parcels.
• Imported
from
https://github.com/zemirco/sf-‐city-‐lots-‐json +
small
tweaks
CREATE TABLE features (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
feature JSON NOT NULL
);
21
- 22. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
{
"type":"Feature",
"geometry":{
"type":"Polygon",
"coordinates":[
[
[-122.42200352825247,37.80848009696725,0],
[-122.42207601332528,37.808835019815085,0],
[-122.42110217434865,37.808803534992904,0],
[-122.42106256906727,37.80860105681814,0],
[-122.42200352825247,37.80848009696725,0]
]
]
},
"properties":{
"TO_ST":"0",
"BLKLOT":"0001001",
"STREET":"UNKNOWN",
"FROM_ST":"0",
"LOT_NUM":"001",
"ST_TYPE":null,
"ODD_EVEN":"E",
"BLOCK_NUM":"0001",
"MAPBLKLOT":"0001001"
}
}
22
- 23. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
Search
23
# Basic Find
SELECT * FROM features
WHERE feature->"$.properties.STREET" = 'MARKET'
LIMIT 1G
************************* 1. row *************************
id: 12250
feature: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates":
[[[-122.39836263491878, 37.79189388899312, 0], [-122.39845248797837,
37.79233030084018, 0], [-122.39768507706792, 37.7924280850133, 0], [-
122.39836263491878, 37.79189388899312, 0]]]}, "properties": {"TO_ST": "388",
"BLKLOT": "0265003", "STREET": "MARKET", "FROM_ST": "388", "LOT_NUM": "003",
"ST_TYPE": "ST", "ODD_EVEN": "E", "BLOCK_NUM": "0265", "MAPBLKLOT":
"0265003"}}
1 row in set (0.02 sec)
Using
short
hand
for
JSON_EXTRACT
- 24. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
Search
24
# Find where not exists
SELECT * FROM features
WHERE feature->"$.properties.STREET" IS NULL
LIMIT 1G
Empty set (0.39 sec)
- 25. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Naive
Performance
Comparison
25
# as JSON type
SELECT DISTINCT
feature->"$.type" AS json_extract
FROM features;
+--------------+
| json_extract |
+--------------+
| "Feature" |
+--------------+
1 row in set (1.25 sec)
Unindexed
traversal
of
206K
documents
# as TEXT type
SELECT DISTINCT
feature->"$.type" AS json_extract
FROM features;
+--------------+
| json_extract |
+--------------+
| "Feature" |
+--------------+
1 row in set (12.85 sec)
Explanation:
Binary
format
of
JSON type
is
very
efficient
at
searching.
Storing
as
TEXT
performs
over
10x
worse
at
traversal.
- 26. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Introducing
Generated
Columns
id my_integer my_integer_plus_one
1 10 11
2 20 21
3 30 31
4 40 41
CREATE TABLE t1 (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
my_integer INT,
my_integer_plus_one INT AS (my_integer+1)
);
UPDATE t1 SET my_integer_plus_one = 10 WHERE id = 1;
ERROR 3105 (HY000): The value specified for generated column
'my_integer_plus_one' in table 't1' is not allowed.
Column
automatically
maintained
based
on
your
specification.
Read-‐only
of
course
26
- 27. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Generated
Columns
Support
Indexes!
ALTER TABLE features ADD feature_type VARCHAR(30) AS (feature->"$.type");
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE features ADD INDEX (feature_type);
Query OK, 0 rows affected (0.73 sec)
Records: 0 Duplicates: 0 Warnings: 0
SELECT DISTINCT feature_type FROM features;
+--------------+
| feature_type |
+--------------+
| "Feature" |
+--------------+
1 row in set (0.06 sec)
From
table
scan
on
206K
documents
to
index
scan
on
206K
materialized
values
27
Meta
data
change
only
(FAST).
Does
not
need
to
touch
table.
Creates
index
only.
Does
not
modify
table
rows.
Down
from
1.25
sec
to
0.06
sec
- 28. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Generated
Columns
(cont.)
• Used
for
“functional
index”
• Available
as
either
VIRTUAL (default)
or
STORED:
• Both types
of
computed
columns
permit
for
indexes
to
be
added.
ALTER TABLE features ADD feature_type VARCHAR(30) AS
(feature->"$.type") STORED;
Query OK, 206560 rows affected (4.70 sec)
Records: 206560 Duplicates: 0 Warnings: 0
28
- 29. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Indexing
Options
Available
STORED VIRTUAL
Primary
and
Secondary
BTREE,
Fulltext,
GIS
Mixed
with
fields
Requires
table
rebuild
Not
Online
Secondary
Only
BTREE Only
Mixed
with
fields
No
table
rebuild
INSTANT
Alter
Faster
Insert
Bottom
Line:
Unless
you
need
a
PRIMARY
KEY,
FULLTEXT
or
GIS
index
VIRTUAL
is
probably
better.
29
- 30. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Virtual
vs.
Stored
Performance
• Approximate
worst
case scenario
via
a
table
scan:
30
SELECT DISTINCT feature_type FROM features;
+--------------+
| feature_type |
+--------------+
| "Feature" |
+--------------+
VIRTUAL-TEXT (10 sec)
VIRTUAL-JSON (1 sec)
STORED-TEXT (0.2 sec)
STORED-JSON (0.2 sec)
Clarification:
Since
indexes
are
materialized
(stored)
themselves,
the
real-‐life
case
for
STORED
is
when
generating
the
column
is
computationally
expensive
and you
can
not
use
indexes
effectively.
- 31. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Unquote
JSON
String
SELECT
DISTINCT JSON_UNQUOTE(feature->"$.type")
AS feature_type
FROM features;
+-----------------+
| feature_type |
+-----------------+
| Feature |
+-----------------+
1 row in set (1.22 sec)
31
- 32. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
Path
Search
• Return
the
first path ('one')
where
the
word
MARKET
appears:
32
SELECT JSON_SEARCH(feature,
'one', 'MARKET') AS
extract_path
FROM features
WHERE id = 121254;
+-----------------------+
| extract_path |
+-----------------------+
| "$.properties.STREET" |
+-----------------------+
1 row in set (0.00 sec)
SELECT
feature->"$.properties.STREET"
AS property_street
FROM features
WHERE id = 121254;
+-----------------+
| property_street |
+-----------------+
| "MARKET" |
+-----------------+
1 row in set (0.00 sec)
- 33. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
Array
Creation
SELECT JSON_ARRAY(id,
feature->"$.properties.STREET",
feature->'$.type") AS json_array
FROM features ORDER BY RAND() LIMIT 3;
+-------------------------------+
| json_array |
+-------------------------------+
| [65298, "10TH", "Feature"] |
| [122985, "08TH", "Feature"] |
| [172884, "CURTIS", "Feature"] |
+-------------------------------+
3 rows in set (2.66 sec)
33
- 34. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
Object
Creation
SELECT JSON_OBJECT('id', id,
'street', feature->"$.properties.STREET",
'type', feature->"$.type"
) AS json_object
FROM features ORDER BY RAND() LIMIT 3;
+--------------------------------------------------------+
| json_object |
+--------------------------------------------------------+
| {"id": 122976, "type": "Feature", "street": "RAUSCH"} |
| {"id": 148698, "type": "Feature", "street": "WALLACE"} |
| {"id": 45214, "type": "Feature", "street": "HAIGHT"} |
+--------------------------------------------------------+
3 rows in set (3.11 sec)
34
- 35. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON_REPLACE
SELECT JSON_REPLACE(feature, '$.type', JSON_ARRAY('feature', 'bug')) AS
json_object FROM features LIMIT 1;
+--------------------------------------------------------+
| json_object |
+--------------------------------------------------------+
| {"type": ["feature", "bug"], "geometry": {"type": ..}} |
+--------------------------------------------------------+
35
- 36. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
• 5.7
supports
functions
to
CREATE,
SEARCH,
MODIFY
and
RETURN
JSON
values:
JSON
Functions
JSON_ARRAY_APPEND()
JSON_ARRAY_INSERT()
JSON_ARRAY()
JSON_CONTAINS_PATH()
JSON_CONTAINS()
JSON_DEPTH()
JSON_EXTRACT()
JSON_INSERT()
JSON_KEYS()
JSON_LENGTH()
JSON_MERGE()
JSON_OBJECT()
JSON_QUOTE()
JSON_REMOVE()
JSON_REPLACE()
JSON_SEARCH()
JSON_SET()
JSON_TYPE()
JSON_UNQUOTE()
JSON_VALID()
https://dev.mysql.com/doc/refman/5.7/en/json-‐functions.html
36
- 37. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
Comparator
37
SELECT CAST(1 AS JSON) = 1;
+---------------------+
| CAST(1 AS JSON) = 1 |
+---------------------+
| 1 |
+---------------------+
1 row in set (0.01 sec)
SELECT CAST('{"num": 1.1}' AS JSON) = CAST('{"num": 1.1}' AS JSON);
+-------------------------------------------------------------+
| CAST('{"num": 1.1}' AS JSON) = CAST('{"num": 1.1}' AS JSON) |
+-------------------------------------------------------------+
| 1 |
+-------------------------------------------------------------+
1 row in set (0.00 sec)
JSON
value
of
1
equals
1
JSON
Objects
Compare
- 38. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
or
Column?
• Up
to
you!
• Advantages
to
both
approaches
38
- 39. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Storing
as
a
Column
• Easier
to
apply
a
schema to
your
application
• Schema may
make
applications
easier
to
maintain
over
time,
as
change
is
controlled;
• Do
not
have
to
expect
as
many
permutations
• Allows
some
constraints
over
data
39
- 40. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Storing
as
JSON
• More
flexible
way
to
represent
data
that
is
hard
to
model
in
schema;
• Imagine
you
are
a
SaaS
application
serving
many
customers
• Strong
use-‐case
to
support
custom-‐fields
• Historically
this
may
have
used
Entity–attribute–value
model
(EAV).
Does
not
always
perform
well
40
- 41. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
JSON
(cont.)
• Easier
denormalization;
an
optimization
that
is
important
in
some
specific
situations
• No
painful
schema
changes*
• Easier
prototyping
• Fewer
types
to
consider
• No
enforced
schema,
start
storing
values
immediately
*
MySQL
5.6
has
Online
DDL.
This
is
not
as
large
of
an
issue
as
it
was
historically.
41
- 42. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Schema
+
Schemaless
SSDs
have
capacity_in_gb,
CPUs
have
a
core_count.
These
attributes
are
not
consistent
across
products.
CREATE TABLE pc_components (
id INT NOT NULL PRIMARY KEY,
description VARCHAR(60) NOT NULL,
vendor VARCHAR(30) NOT NULL,
serial_number VARCHAR(30) NOT NULL,
attributes JSON NOT NULL
);
42
- 43. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Optimizer
Hints
• Max_Execution_Time
– Example
– max
1
second
– note
-‐ these
go
in
as
comments
• SELECT
/*+
MAX_EXECUTION_TIME(1000)
*/
*
FROM
t1
INNER
JOIN
t2
WHERE
...
BNL
– Block
Nested-‐Loop
• BKA/NO_BKA
– Batch
Key
Access
• MRR/NO_MRR
– Multi-‐Range
Read
• NO_RANGE_OPTIMIZATION
• ICP/NO_ICP
– Index
Condition
Pushdown
• SEMIJOIN
• SUBQUERY
Enhance
performance
by
giving
the
Optimizer
1
or
more
hints.
Oracle
Confidential
– Internal/Restricted/H ighly
Restricted 43
- 44. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
MySQL
5.7:
Query
Rewrite
Plugin
• New
pre
and
post
parse
query
rewrite
APIs
– Users
can
write
their
own
plug-‐ins
• Provides
a
post-‐parse
query
plugin
– Rewrite
problematic
queries
without
the
need
to
make
application
changes
– Add
hints
– Modify
join
order
– Many
more
…
• Improve
problematic
queries
from
ORMs,
third
party
apps,
etc
• Eliminates
many
legacy
use
cases
for
proxies
44
- 45. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
• Native
Partitioning
– Eliminates
previous
limitations
– Eliminates
resource
usage
problems
– Transportable
tablespace
support
• Native
Full-‐Text
Search
– Including
full
CJK
support!
• Native
Spatial
Indexes
• Transparent
page
compression
• Support
for
32K
and
64K
pages
– Use
with
transparent
page
compression
for
very
high
compression
ratios
• General
TABLESPACE
support
– Store
multiple
tables
in
user
defined
shared
tablespaces
• Support
for
MySQL
Group
Replication
– High
priority
transactions
• Improved
support
for
cache
preloading
– Load
your
hottest
data
loaded
at
startup
• Configurable
fill-‐factor
– Allows
for
improvements
in
storage
footprint
• Improved
bulk-‐data
load
performance
• Resize
the
InnoDB
Buffer
Pool
online
MySQL
5.7:
InnoDB
Improvements
45
- 46. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Memory
Instrumentation
• Aggregates
statistics
by
– Type
of
memory
used
(caches,
internal
buffers,
…)
– Thread/account/user/host
indirectly
performing
the
memory
operation
• Attributes
include
– Memory
used
(bytes)
– Operation
counts
– High/Low
Water
Marks
Statement
Instrumentation
• Stored
Procedures
• Stored
Functions
• Prepared
Statements
• Transactions
Additional
Information
• Replication
slave
status
• MDL
lock
instrumentation
• Status
and
variables
per
thread
• Server
stage
tracking
• Track
long
running
SQL
• Improved
configuration
and
ease-‐of-‐use
• All
while
reducing total
footprint
and
overhead
MySQL
5.7:
Performance
Schema
46
- 47. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
MySQL
5.7:
SYS
Schema
SYS
views
make
it
easier
to
-‐ Monitor
server
health,
user,
host
statistics
-‐ Spot,
diagnose,
and
tune
performance
issues
• Provides
insights
into
-‐ IO
hot
spots,
Locking,
Costly
SQL
statements
-‐ Schema,
table
and
index
statistics
• SYS
is
similar
to
-‐ Oracle
V$
catalog
views
-‐ Microsoft
SQL
DMVs
(Dynamic
Mgmnt
Views)
47
- 48. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
• Replaced
custom
code
with
Boost.Geometry
– For
spatial
calculations
– For
spatial
analysis
– Enabling
full
OGC
compliance
– We’re
also
Boost.Geometry
contributors!
• InnoDB
R-‐tree
based
spatial
indexes
– Full
ACID,
MVCC,
&
transactional
support
– Index
records
contain
minimum
bounding
box
• GeoHash
• GeoJSON
• Helper
functions
such
as
ST_Distance_Sphere() and
ST_MakeEnvelope()
MySQL
5.7:
GIS
Improvements
48
- 49. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
• AES
256
Encryption
now
the
default
• Password
rotation
policies
– Can
be
set
globally,
and
at
the
user
level
• Deployment:
enable
secure
unattended
install
by
default
– Random
password
set
on
install
– Remove
anonymous
accounts
– Deployment
without
test
account,
schema,
demo
files
• Easier
instance
initialization
and
setup:
mysqld
–initialize
• New
detection
and
support
for
systemd
• SSL
– Enabled
by
default
– Auto-‐detection
of
existing
keys
and
certs
– Auto
generation
of
keys
and
certs
when
needed
– New
helper
utility:
mysql_ssl_rsa_setup
– New
-‐-‐require_secure_transport option
to
prevent
insecure
communications
– Added
SSL
support
to
binary
log
clients
• Extended
Proxy
User
Support
– Added
Built-‐in
Authentication
Plugins
support
for
Proxy
Users
– Allows
multiple
users
to
share
a
single
set
of
managed
privileges
MySQL
5.7:
Security
Improvements
49
- 50. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
• Download
MySQL
products
dev.mysql.com/downloads/
• Read
MySQL
documentation
dev.mysql.com/doc/
• Get
help
from
the
community
in
the
MySQL
forums
forums.mysql.com
• Watch
on-‐demand
webinars
mysql.com/news-‐and-‐events/on-‐demand-‐
webinars/
• Follow
the
latest
news
and
upcoming
events
from
MySQL
facebook.com/mysql
twitter.com/mysql
plus.google.com/+mysql
• Watch
MySQL
tutorials
and
interviews
Youtube.com/mysqlchannel
Resources
50
- 51. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Q+A
- 52. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
|
Keep
Learning
with
MySQL
Training
from
Oracle
University
52
• Hands-‐on
training
delivered
in-‐class
or
online
by
tenured
instructors
around
the
world
• New
subscription-‐based
learning
services
to
give
you
any-‐time
access
to
training
• Certification
programs
to
validate
your
skills
education.oracle.com/mysql
- 53. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
| 53
- 54. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
| 54
- 55. Copyright
©
2016
Oracle
and/or
its
affiliates.
All
rights
reserved.
| 55