SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
Copyright © 2018 Oracle and/or its afliates. All rights reserved.
MySQL 8.0 GIS Overview
Norvald H. Ryeng
Sofware Engineer
March 2018
3Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Safe Harbor Statement
The following is intended to outline our general product directon. It is intended for
informaton purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functonality, and should not be relied upon
in making purchasing decisions. The development, release, and tming of any features or
functonality described for Oracle’s products remains at the sole discreton of Oracle.
4Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Agenda
Data Types
Spatal Reference Systems
Functons
Indexes
Upgrade Issues
1
2
3
4
5
6
7
5Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Data Types
● Geometry
– Point
– Linestring
– Polygon
– Geometry collecton
● Multpoint
● Multlinestring
● Multpolygon
Non-instantable, but can be used as column type.
6Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Spatal Reference Systems
SRID 0 Projected SRS
Cartesian SRS
5.7 8.0
Geographic SRS
7Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Spatal Reference Systems
● Each SRS has a unique spatal reference system ID (SRID)
– Numeric identfer
– No formal standard/catalog of SRIDs
– De facto standard: EPSG Dataset
● 4326 = WGS 84 (“GPS coordinates”)
● 3857 = WGS 84 / World Mercator (“Web Mercator”)
● A property of each geometry value
● Mixing geometries in diferent SRIDs in one computaton
doesn't make sense and will raise an error (also in 5.7)
8Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Spatal Reference Systems
● 5107 predefned SRSs from the EPSG Dataset 9.2 (MySQL
8.0.4)
– 4628 projected
– 479 geographic
● Exposed through an INFORMATION_SCHEMA view,
ST_SPATIAL_REFERENCE_SYSTEMS
● CREATE/DROP SPATIAL REFERENCE SYSTEM statements to
create your own
9Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Example
CREATE TABLE cites (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(20) NOT NULL,
loc POINT SRID 4326 NOT NULL
);
INSERT INTO cites (name, loc) VALUES (
'Trondheim',
ST_GeomFromText('POINT(63.43048320193547 10.394972698312927)', 4326)
);
INSERT INTO cites (name, loc) VALUES (
'San Francisco',
ST_GeomFromText('POINT(37.2726156666666667 -122.44254551944445)', 4326)
);
10Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Functons
● Import
– ST_GeomCollFromTxt/ST_GeomCollFromText, ST_GeomCollFromWKB,
ST_GeomFromGeoJSON, ST_GeomFromText, ST_GeomFromWKB,
ST_LineFromText, ST_LineFromWKB, ST_MLineFromText,
ST_MLineFromWKB, ST_MPointFromText, ST_MPointFromWKB,
ST_MPolyFromText, ST_MPolyFromWKB, ST_PointFromGeohash,
ST_PolyFromText, ST_PolyFromWKB
● Export
– ST_AsBinary, ST_AsGeoJSON, ST_AsText, ST_Geohash
11Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Functons
● Comparison
– ST_Contains, ST_Crosses, ST_Disjoint, ST_Equals, ST_Intersects,
ST_Overlaps, ST_Touches, ST_Within
– MBRContains, MBRCoveredBy, MBRCovers, MBRDisjoint, MBREquals,
MBRIntersects, MBROverlaps, MBRTouches, MBRWithin
● Produce new geometries
– ST_Bufer, ST_Centroid, ST_ConvexHull, ST_Envelope,
ST_MakeEnvelope, ST_Simplify, ST_Diference, ST_Intersecton,
ST_SymDiference, ST_Union
12Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Functons
13Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Functons
● Measures
– ST_Area, ST_Distance, ST_Distance_Sphere, ST_Length
● Extract propertes
– ST_GeometryN, ST_GeometryType, ST_InteriorRingN, ST_IsClosed,
ST_IsEmpty, ST_IsSimple, ST_IsValid, ST_PointN, ST_SRID,
ST_StartPoint, ST_X, ST_Y
● Helper functons
– ST_LatFromGeohash, ST_LongFromGeohash, ST_Validate, ST_SwapXY
14Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Example
SELECT ST_Distance(
(SELECT loc FROM cites WHERE name='Trondheim'),
(SELECT loc FROM cites WHERE name='San Francisco')
) AS exact_distance;
exact_distance
8089891.633435546
SELECT ST_Distance_Sphere(
(SELECT loc FROM cites WHERE name='Trondheim'),
(SELECT loc FROM cites WHERE name='San Francisco')
) AS approx_distance;
approx_distance
8068723.414049273
15Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Indexes
● R-tree indexes on spatal data
– Cartesian or geographic, depending on SRID
● Geographic R-trees in InnoDB only
● Used automatcally by the optmizer
– Triggered by use of spatal relatons (ST_Within, etc.)
– Cost based decision making
16Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Example
CREATE SPATIAL INDEX loc_idx ON cites (loc);
SET @europe=ST_GeomFromText('POLYGON((2.49 83.51,-15.09 68.37,-28.80 66.19,-12.63 35.10,6.71
38.48,23.23 33.94,29.56 43.51,38.00 43.51,60.85 69.98,78.42 83.51,2.49 83.51))', 4326, 'axis-
order=long-lat');
SELECT name FROM cites WHERE ST_Within(loc, @europe);
exact_distance
Trondheim
EXPLAIN SELECT name FROM cites WHERE ST_Within(loc, @europe);
+----+-------------+--------+------------+-------+---------------+---------+---------+------+------+----------+-------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+--------+------------+-------+---------------+---------+---------+------+------+----------+-------------+
| 1 | SIMPLE | cities | NULL | range | loc_idx | loc_idx | 34 | NULL | 2 | 100.00 | Using where |
+----+-------------+--------+------------+-------+---------------+---------+---------+------+------+----------+-------------+
Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Upgrade Issues
18Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Upgrade Issues
● YES, there are upgrade issues!
– We're sorry, but we have to …
● All EPSG SRSs are lattude frst, longitude second
– WKT and WKB input/output uses SRS axis order by default
● Can be overridden with 'axis-order=long-lat'
● Override opton not available in 5.7
– Earlier MySQL versions don't understand axis order, X=X and Y=Y
– Queries and/or scripts must be changed
● Storage format is stll longitude frst, lattude second
– Compatble with the limited geography support in 5.7
19Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Upgrade Issues
● SRID 0 is the safe choice if using MySQL pre 8.0
– Set correct SRS afer upgrading
● Indexes must be recreated afer upgrade
– Column defniton must be modifed to use SRID restricton frst
● The SRID restricton is not available in 5.7
– Indexes on columns without SRID restricton will never be used
● Ignored by the optmizer
● Allowed to exist in order to preserve dump-restore compatbility
● Warnings will be issued
20Copyright © 2018 Oracle and/or its afliates. All rights reserved.
✓✓
Prepare Now
● Think through your use of SRIDs
– Use SRID 0 if you're unsure
● Use longitude-lattude ordering in 5.7
– But remember that import and export functons follow SRS defned
axis order in 8.0
● Use one SRID in each column
– Be ready to add SRID restrictons to columns and rebuild indexes in 8.0
Copyright © 2018 Oracle and/or its afliates. All rights reserved.
Feature descriptons and design details
directly from the source.
https:/ppmysslsserverteamy.comyp
22Copyright © 2018 Oracle and/or its afliates. All rights reserved.
MySQL 8.0 GIS Overview

Contenu connexe

Tendances

PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PGConf APAC
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQLMydbops
 
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...NTT DATA Technology & Innovation
 
Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Mydbops
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsMydbops
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18Derek Downey
 
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DBDistributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DBYugabyteDB
 
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016Wagner Bianchi
 
Oracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesOracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesBobby Curtis
 
Bloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQLBloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQLMasahiko Sawada
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1Federico Campoli
 
ClickHouse new features and development roadmap, by Aleksei Milovidov
ClickHouse new features and development roadmap, by Aleksei MilovidovClickHouse new features and development roadmap, by Aleksei Milovidov
ClickHouse new features and development roadmap, by Aleksei MilovidovAltinity Ltd
 
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...Ludovico Caldara
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)Altinity Ltd
 
MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting Mydbops
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsMydbops
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialJean-François Gagné
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationFrancisco Gonçalves
 
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0Olivier DASINI
 

Tendances (20)

PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQL
 
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
 
Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability Methods
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
 
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DBDistributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
 
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016
 
Oracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesOracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best Practices
 
Bloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQLBloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQL
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1
 
ClickHouse new features and development roadmap, by Aleksei Milovidov
ClickHouse new features and development roadmap, by Aleksei MilovidovClickHouse new features and development roadmap, by Aleksei Milovidov
ClickHouse new features and development roadmap, by Aleksei Milovidov
 
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
 
MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentation
 
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
 

Similaire à MySQL 8.0 GIS Overview

How to Take Advantage of Optimizer Improvements in MySQL 8.0
How to Take Advantage of Optimizer Improvements in MySQL 8.0How to Take Advantage of Optimizer Improvements in MySQL 8.0
How to Take Advantage of Optimizer Improvements in MySQL 8.0Norvald Ryeng
 
MySQL 8.0: What Is New in Optimizer and Executor?
MySQL 8.0: What Is New in Optimizer and Executor?MySQL 8.0: What Is New in Optimizer and Executor?
MySQL 8.0: What Is New in Optimizer and Executor?Norvald Ryeng
 
Reading The Source Code of Presto
Reading The Source Code of PrestoReading The Source Code of Presto
Reading The Source Code of PrestoTaro L. Saito
 
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...Jean Ihm
 
Predicting Flight Delays with Spark Machine Learning
Predicting Flight Delays with Spark Machine LearningPredicting Flight Delays with Spark Machine Learning
Predicting Flight Delays with Spark Machine LearningCarol McDonald
 
Wellington APAC Groundbreakers tour - Upgrading to the 12c Optimizer
Wellington APAC Groundbreakers tour - Upgrading to the 12c OptimizerWellington APAC Groundbreakers tour - Upgrading to the 12c Optimizer
Wellington APAC Groundbreakers tour - Upgrading to the 12c OptimizerConnor McDonald
 
MySQL 8.0 Graphical Information System - Mid Atlantic Developers Conference
MySQL 8.0 Graphical Information System - Mid Atlantic Developers ConferenceMySQL 8.0 Graphical Information System - Mid Atlantic Developers Conference
MySQL 8.0 Graphical Information System - Mid Atlantic Developers ConferenceDave Stokes
 
Setting up the Oracle Optimizer for Proof of Concept Testing
Setting up the Oracle Optimizer for Proof of Concept TestingSetting up the Oracle Optimizer for Proof of Concept Testing
Setting up the Oracle Optimizer for Proof of Concept TestingNigel Bayliss
 
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI InternalsApache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI InternalsIsuru Perera
 
Top 10 SQL Performance tips & tricks for Java Developers
Top 10 SQL Performance tips & tricks for Java DevelopersTop 10 SQL Performance tips & tricks for Java Developers
Top 10 SQL Performance tips & tricks for Java Developersgvenzl
 
Gain Insights with Graph Analytics
Gain Insights with Graph Analytics Gain Insights with Graph Analytics
Gain Insights with Graph Analytics Jean Ihm
 
Spatial Support in MySQL
Spatial Support in MySQLSpatial Support in MySQL
Spatial Support in MySQLNorvald Ryeng
 
Cisco Connect Toronto 2018 model-driven programmability for cisco ios xr-v1
Cisco Connect Toronto 2018   model-driven programmability for cisco ios xr-v1Cisco Connect Toronto 2018   model-driven programmability for cisco ios xr-v1
Cisco Connect Toronto 2018 model-driven programmability for cisco ios xr-v1Cisco Canada
 
Airframe: Lightweight Building Blocks for Scala @ TD Tech Talk 2018-10-17
Airframe: Lightweight Building Blocks for Scala @ TD Tech Talk 2018-10-17Airframe: Lightweight Building Blocks for Scala @ TD Tech Talk 2018-10-17
Airframe: Lightweight Building Blocks for Scala @ TD Tech Talk 2018-10-17Taro L. Saito
 
Melbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and TipsMelbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and TipsConnor McDonald
 
How To Use Scala At Work - Airframe In Action at Arm Treasure Data
How To Use Scala At Work - Airframe In Action at Arm Treasure DataHow To Use Scala At Work - Airframe In Action at Arm Treasure Data
How To Use Scala At Work - Airframe In Action at Arm Treasure DataTaro L. Saito
 
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatengeKarin Patenge
 
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentation
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs PresentationADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentation
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentationprashant3535
 
The Sierra Supercomputer: Science and Technology on a Mission
The Sierra Supercomputer: Science and Technology on a MissionThe Sierra Supercomputer: Science and Technology on a Mission
The Sierra Supercomputer: Science and Technology on a Missioninside-BigData.com
 

Similaire à MySQL 8.0 GIS Overview (20)

How to Take Advantage of Optimizer Improvements in MySQL 8.0
How to Take Advantage of Optimizer Improvements in MySQL 8.0How to Take Advantage of Optimizer Improvements in MySQL 8.0
How to Take Advantage of Optimizer Improvements in MySQL 8.0
 
MySQL 8.0: What Is New in Optimizer and Executor?
MySQL 8.0: What Is New in Optimizer and Executor?MySQL 8.0: What Is New in Optimizer and Executor?
MySQL 8.0: What Is New in Optimizer and Executor?
 
Reading The Source Code of Presto
Reading The Source Code of PrestoReading The Source Code of Presto
Reading The Source Code of Presto
 
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
 
Predicting Flight Delays with Spark Machine Learning
Predicting Flight Delays with Spark Machine LearningPredicting Flight Delays with Spark Machine Learning
Predicting Flight Delays with Spark Machine Learning
 
Wellington APAC Groundbreakers tour - Upgrading to the 12c Optimizer
Wellington APAC Groundbreakers tour - Upgrading to the 12c OptimizerWellington APAC Groundbreakers tour - Upgrading to the 12c Optimizer
Wellington APAC Groundbreakers tour - Upgrading to the 12c Optimizer
 
MySQL 8.0 Graphical Information System - Mid Atlantic Developers Conference
MySQL 8.0 Graphical Information System - Mid Atlantic Developers ConferenceMySQL 8.0 Graphical Information System - Mid Atlantic Developers Conference
MySQL 8.0 Graphical Information System - Mid Atlantic Developers Conference
 
Setting up the Oracle Optimizer for Proof of Concept Testing
Setting up the Oracle Optimizer for Proof of Concept TestingSetting up the Oracle Optimizer for Proof of Concept Testing
Setting up the Oracle Optimizer for Proof of Concept Testing
 
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI InternalsApache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
 
Top 10 SQL Performance tips & tricks for Java Developers
Top 10 SQL Performance tips & tricks for Java DevelopersTop 10 SQL Performance tips & tricks for Java Developers
Top 10 SQL Performance tips & tricks for Java Developers
 
Gain Insights with Graph Analytics
Gain Insights with Graph Analytics Gain Insights with Graph Analytics
Gain Insights with Graph Analytics
 
Spatial Support in MySQL
Spatial Support in MySQLSpatial Support in MySQL
Spatial Support in MySQL
 
Cisco Connect Toronto 2018 model-driven programmability for cisco ios xr-v1
Cisco Connect Toronto 2018   model-driven programmability for cisco ios xr-v1Cisco Connect Toronto 2018   model-driven programmability for cisco ios xr-v1
Cisco Connect Toronto 2018 model-driven programmability for cisco ios xr-v1
 
Airframe: Lightweight Building Blocks for Scala @ TD Tech Talk 2018-10-17
Airframe: Lightweight Building Blocks for Scala @ TD Tech Talk 2018-10-17Airframe: Lightweight Building Blocks for Scala @ TD Tech Talk 2018-10-17
Airframe: Lightweight Building Blocks for Scala @ TD Tech Talk 2018-10-17
 
Melbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and TipsMelbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and Tips
 
How To Use Scala At Work - Airframe In Action at Arm Treasure Data
How To Use Scala At Work - Airframe In Action at Arm Treasure DataHow To Use Scala At Work - Airframe In Action at Arm Treasure Data
How To Use Scala At Work - Airframe In Action at Arm Treasure Data
 
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
 
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentation
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs PresentationADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentation
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentation
 
The Sierra Supercomputer: Science and Technology on a Mission
The Sierra Supercomputer: Science and Technology on a MissionThe Sierra Supercomputer: Science and Technology on a Mission
The Sierra Supercomputer: Science and Technology on a Mission
 
Doc store
Doc storeDoc store
Doc store
 

Dernier

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
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
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%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 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
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Dernier (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
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...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%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 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
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

MySQL 8.0 GIS Overview

  • 1. Copyright © 2018 Oracle and/or its afliates. All rights reserved. MySQL 8.0 GIS Overview Norvald H. Ryeng Sofware Engineer March 2018
  • 2. 3Copyright © 2018 Oracle and/or its afliates. All rights reserved. Safe Harbor Statement The following is intended to outline our general product directon. It is intended for informaton purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functonality, and should not be relied upon in making purchasing decisions. The development, release, and tming of any features or functonality described for Oracle’s products remains at the sole discreton of Oracle.
  • 3. 4Copyright © 2018 Oracle and/or its afliates. All rights reserved. Agenda Data Types Spatal Reference Systems Functons Indexes Upgrade Issues 1 2 3 4 5 6 7
  • 4. 5Copyright © 2018 Oracle and/or its afliates. All rights reserved. Data Types ● Geometry – Point – Linestring – Polygon – Geometry collecton ● Multpoint ● Multlinestring ● Multpolygon Non-instantable, but can be used as column type.
  • 5. 6Copyright © 2018 Oracle and/or its afliates. All rights reserved. Spatal Reference Systems SRID 0 Projected SRS Cartesian SRS 5.7 8.0 Geographic SRS
  • 6. 7Copyright © 2018 Oracle and/or its afliates. All rights reserved. Spatal Reference Systems ● Each SRS has a unique spatal reference system ID (SRID) – Numeric identfer – No formal standard/catalog of SRIDs – De facto standard: EPSG Dataset ● 4326 = WGS 84 (“GPS coordinates”) ● 3857 = WGS 84 / World Mercator (“Web Mercator”) ● A property of each geometry value ● Mixing geometries in diferent SRIDs in one computaton doesn't make sense and will raise an error (also in 5.7)
  • 7. 8Copyright © 2018 Oracle and/or its afliates. All rights reserved. Spatal Reference Systems ● 5107 predefned SRSs from the EPSG Dataset 9.2 (MySQL 8.0.4) – 4628 projected – 479 geographic ● Exposed through an INFORMATION_SCHEMA view, ST_SPATIAL_REFERENCE_SYSTEMS ● CREATE/DROP SPATIAL REFERENCE SYSTEM statements to create your own
  • 8. 9Copyright © 2018 Oracle and/or its afliates. All rights reserved. Example CREATE TABLE cites ( id INTEGER AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20) NOT NULL, loc POINT SRID 4326 NOT NULL ); INSERT INTO cites (name, loc) VALUES ( 'Trondheim', ST_GeomFromText('POINT(63.43048320193547 10.394972698312927)', 4326) ); INSERT INTO cites (name, loc) VALUES ( 'San Francisco', ST_GeomFromText('POINT(37.2726156666666667 -122.44254551944445)', 4326) );
  • 9. 10Copyright © 2018 Oracle and/or its afliates. All rights reserved. Functons ● Import – ST_GeomCollFromTxt/ST_GeomCollFromText, ST_GeomCollFromWKB, ST_GeomFromGeoJSON, ST_GeomFromText, ST_GeomFromWKB, ST_LineFromText, ST_LineFromWKB, ST_MLineFromText, ST_MLineFromWKB, ST_MPointFromText, ST_MPointFromWKB, ST_MPolyFromText, ST_MPolyFromWKB, ST_PointFromGeohash, ST_PolyFromText, ST_PolyFromWKB ● Export – ST_AsBinary, ST_AsGeoJSON, ST_AsText, ST_Geohash
  • 10. 11Copyright © 2018 Oracle and/or its afliates. All rights reserved. Functons ● Comparison – ST_Contains, ST_Crosses, ST_Disjoint, ST_Equals, ST_Intersects, ST_Overlaps, ST_Touches, ST_Within – MBRContains, MBRCoveredBy, MBRCovers, MBRDisjoint, MBREquals, MBRIntersects, MBROverlaps, MBRTouches, MBRWithin ● Produce new geometries – ST_Bufer, ST_Centroid, ST_ConvexHull, ST_Envelope, ST_MakeEnvelope, ST_Simplify, ST_Diference, ST_Intersecton, ST_SymDiference, ST_Union
  • 11. 12Copyright © 2018 Oracle and/or its afliates. All rights reserved. Functons
  • 12. 13Copyright © 2018 Oracle and/or its afliates. All rights reserved. Functons ● Measures – ST_Area, ST_Distance, ST_Distance_Sphere, ST_Length ● Extract propertes – ST_GeometryN, ST_GeometryType, ST_InteriorRingN, ST_IsClosed, ST_IsEmpty, ST_IsSimple, ST_IsValid, ST_PointN, ST_SRID, ST_StartPoint, ST_X, ST_Y ● Helper functons – ST_LatFromGeohash, ST_LongFromGeohash, ST_Validate, ST_SwapXY
  • 13. 14Copyright © 2018 Oracle and/or its afliates. All rights reserved. Example SELECT ST_Distance( (SELECT loc FROM cites WHERE name='Trondheim'), (SELECT loc FROM cites WHERE name='San Francisco') ) AS exact_distance; exact_distance 8089891.633435546 SELECT ST_Distance_Sphere( (SELECT loc FROM cites WHERE name='Trondheim'), (SELECT loc FROM cites WHERE name='San Francisco') ) AS approx_distance; approx_distance 8068723.414049273
  • 14. 15Copyright © 2018 Oracle and/or its afliates. All rights reserved. Indexes ● R-tree indexes on spatal data – Cartesian or geographic, depending on SRID ● Geographic R-trees in InnoDB only ● Used automatcally by the optmizer – Triggered by use of spatal relatons (ST_Within, etc.) – Cost based decision making
  • 15. 16Copyright © 2018 Oracle and/or its afliates. All rights reserved. Example CREATE SPATIAL INDEX loc_idx ON cites (loc); SET @europe=ST_GeomFromText('POLYGON((2.49 83.51,-15.09 68.37,-28.80 66.19,-12.63 35.10,6.71 38.48,23.23 33.94,29.56 43.51,38.00 43.51,60.85 69.98,78.42 83.51,2.49 83.51))', 4326, 'axis- order=long-lat'); SELECT name FROM cites WHERE ST_Within(loc, @europe); exact_distance Trondheim EXPLAIN SELECT name FROM cites WHERE ST_Within(loc, @europe); +----+-------------+--------+------------+-------+---------------+---------+---------+------+------+----------+-------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+--------+------------+-------+---------------+---------+---------+------+------+----------+-------------+ | 1 | SIMPLE | cities | NULL | range | loc_idx | loc_idx | 34 | NULL | 2 | 100.00 | Using where | +----+-------------+--------+------------+-------+---------------+---------+---------+------+------+----------+-------------+
  • 16. Copyright © 2018 Oracle and/or its afliates. All rights reserved. Upgrade Issues
  • 17. 18Copyright © 2018 Oracle and/or its afliates. All rights reserved. Upgrade Issues ● YES, there are upgrade issues! – We're sorry, but we have to … ● All EPSG SRSs are lattude frst, longitude second – WKT and WKB input/output uses SRS axis order by default ● Can be overridden with 'axis-order=long-lat' ● Override opton not available in 5.7 – Earlier MySQL versions don't understand axis order, X=X and Y=Y – Queries and/or scripts must be changed ● Storage format is stll longitude frst, lattude second – Compatble with the limited geography support in 5.7
  • 18. 19Copyright © 2018 Oracle and/or its afliates. All rights reserved. Upgrade Issues ● SRID 0 is the safe choice if using MySQL pre 8.0 – Set correct SRS afer upgrading ● Indexes must be recreated afer upgrade – Column defniton must be modifed to use SRID restricton frst ● The SRID restricton is not available in 5.7 – Indexes on columns without SRID restricton will never be used ● Ignored by the optmizer ● Allowed to exist in order to preserve dump-restore compatbility ● Warnings will be issued
  • 19. 20Copyright © 2018 Oracle and/or its afliates. All rights reserved. ✓✓ Prepare Now ● Think through your use of SRIDs – Use SRID 0 if you're unsure ● Use longitude-lattude ordering in 5.7 – But remember that import and export functons follow SRS defned axis order in 8.0 ● Use one SRID in each column – Be ready to add SRID restrictons to columns and rebuild indexes in 8.0
  • 20. Copyright © 2018 Oracle and/or its afliates. All rights reserved. Feature descriptons and design details directly from the source. https:/ppmysslsserverteamy.comyp
  • 21. 22Copyright © 2018 Oracle and/or its afliates. All rights reserved.