MySQL 8 -- Rocky Mountain Oracle User Group Training Days 2017

33
MySQL 8

Transcript of MySQL 8 -- Rocky Mountain Oracle User Group Training Days 2017

MySQL 8

Safe Harbor Agreement

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

Hello!I AM Dave Stokes

I am here because I love to give

presentations & RMOUG.

You can find me at:

@stoker

[email protected]

Elephantanddolphin.blogger.com

Opensourcedba.wordpress.com

3

1Why 8?

Let’s start with the

first question

4

Why MySQL 8??

▪ Current GA is 5.7 (October 2015)

▪ MySQL Cluster is 7.5.4

▪ There was a MySQL 6 in the

pre-Sun days

Engineering thought the new data

dictionary and other new features

justified the new major release

number.

5

2Data Dictionary

The big infrastructure

change

6

Too Many FilesEvery look in the data

directory of a MySQL schema?

7

You have a plethora of files out there -- .FRM .MYD .MYI .OPT and many more just waiting for something to go bad -- now store relevant information in data dictionary!

8

Good

Innodb is robust enough to

rebuild all information to

a point in time in case of

problems. So keep

EVERYTHING in internal data

structures. And that leads

to transactional ALTER TABLE commands.

Good news and maybe good news

Maybe good

The file system is no

longer the limiting factor.

So now you can have

millions of tables within a

schema.

The bad news there is that

you can have millions of

tables within a schema.

9

2CTEs & Windowing

Developers have been

asking for them for a

long time

10

CTE example

WITH RECURSIVE my_cte AS( SELECT 1 AS n UNION ALL SELECT 1+n FROM my_cte WHERE n<10)SELECT * FROM my_cte; +------+| n |+------+| 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 |+------+10 rows in set (0,00 sec)

11

Windowing Functions

SELECT date, amount, sum(amount) OVER w AS ‘sum’ FROM paymentsWINDOW w AS (ORDER BY date RANGE BETWEEN INTERVAL 1 WEEK PRECEDING AND CURRENT ROW)ORDER BY date;

12

3Optimizer & Parser

What has been done to

make MySQL faster,

better, and stronger!

14

Optimizer & Parser

Bye-bye \N -- a synonym for

NULL in SQL statements.

Descending indexes

Optimizer trace output now

includes more information

about filesort operations,

such as key and payload

size and why addon fields

are not packed.

The optimizer now supports

hints that enable

specifying the order in

which to join tables.

15

4Roles

No more turning on each

permission for each

account

16

Roles

MySQL now supports roles, which are

named collections of privileges.

Roles can be created and dropped.

Roles can have privileges granted

to and revoked from them. Roles can

be granted to and revoked from user

accounts. The active applicable

roles for an account can be

selected from among those granted

to the account, and can be changed

during sessions for that account. 17

5Character Sets

Big changes bring big

emojis

18

When UTF8 is not UTF8

MySQL 8 witll be UTF8MB4!

Previously UTF8 was actually UTF8MB3

> 3 byes, no emojis

> Supplementary multi-lingual plane support

limited

> No CJK Unified Ideographs Extension B are

in supplementary ideographic plane

> Upgrade problem expected!

19

Charset and Collation

utf8mb4_0900_ai_ci:

- 0900 refers to Unicode

Collation Algorithm

version.

- ai refers to accent

insensitive.

- ci refers to case

insensitive.

UTF8MB4

So yes you can have emojis!

20

6Invisible Indexes

A handy idea for query

tuning

21

Invisible Indexes

An invisible index is not used by

the optimizer at all, but is

otherwise maintained normally.

Indexes are visible by default.

Invisible indexes make it possible

to test the effect of removing an

index on query performance, without

making a destructive change that

must be undone should the index

turn out to be required

22

7SET PERSIST

Ch-Ch-Changes only

worked for David Bowie

and Queen

23

SET PERSIST

mysql> SET PERSIST innodb_buffer_pool_size = 512 * 1024 * 1024;

Query OK, 0 rows affected (0.01 sec)

A MySQL server can be

configured and managed over

a SQL connection thus

removing manual file

operations (on

configuration files) to be

done by DBAs. This feature

addresses the usability

issues described above, and

allows MySQL to be more

easily deployed and

configured on cloud

platforms.

The file mysqld-auto.cnf

is created the first time

a SET PERSIST statement is

executed. Further SET

PERSIST statement

executions will append the

contents to this file.

This file is in JSON

format and can be parsed

using json parser.

24

Yes, we know that servers can be hard to manage and get

harder when they are in the cloud and out of reach of

‘percussive maintenance’ techniques.

Decoupling features like Group Replication and Document

Store from release cycle to make updates easier

25

Other new features not dependant on server GA

83D Geometry

We really are going

places!!

26

http://www.slideshare.net/NorvaldRyeng/mysql-80-

gis-are-you-ready

27

World can now be flat or ellipsoidal

Coordinate system wrap around

Boot.Geometry & Open GID

“GIS is a form of digital mapping

technology. Kind of like Google Earth but

better.”

-- Arnold Schwartzenegger

Governor of California

28

Test Todayhttps://dev.mysql.com/downloads/mysql/

USe MySQL 8 today, but

not in production -- it

is not GA yet

29

DMRsDeveloper Milestone Releases

have special features like CTEs

and are available at

https://labs.mysql.com30

Supported tags and respective Dockerfile links

8.0.0, 8.0, 8 (8.0/Dockerfile)

5.7.17, 5.7, 5, latest (5.7/Dockerfile)

5.6.35, 5.6 (5.6/Dockerfile)

5.5.54, 5.5 (5.5/Dockerfile)

Docker Images https://hub.docker.com/_/mysql/

31

We have gone

About as far as

we can for now!

32

Thanks!ANY QUESTIONS?

You can find me at:

@stoker

[email protected]

slideshare.net/davidmstokes

33