SlideShare a Scribd company logo
1 of 22
Download to read offline
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

More Related Content

What's hot

MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterKenny Gryp
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationUlf Wendel
 
MongoDB Backups and PITR
MongoDB Backups and PITRMongoDB Backups and PITR
MongoDB Backups and PITRIgor Donchovski
 
MySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesMySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesFrederic Descamps
 
Percona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemPercona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemFrederic Descamps
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesFrederic Descamps
 
Open Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsOpen Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsFrederic Descamps
 
MariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAsMariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAsFederico Razzoli
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionFrederic Descamps
 
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
 
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...Frederic Descamps
 
Using all of the high availability options in MariaDB
Using all of the high availability options in MariaDBUsing all of the high availability options in MariaDB
Using all of the high availability options in MariaDBMariaDB plc
 
Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Mydbops
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLOlivier DASINI
 
Upgrade to MySQL 8.0!
Upgrade to MySQL 8.0!Upgrade to MySQL 8.0!
Upgrade to MySQL 8.0!Ted Wennmark
 
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1Jean-François Gagné
 
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMiguel Araújo
 

What's hot (20)

InnoDb Vs NDB Cluster
InnoDb Vs NDB ClusterInnoDb Vs NDB Cluster
InnoDb Vs NDB Cluster
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
MongoDB Backups and PITR
MongoDB Backups and PITRMongoDB Backups and PITR
MongoDB Backups and PITR
 
MySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesMySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best Practices
 
Percona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemPercona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database System
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL Architectures
 
Open Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsOpen Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and Histograms
 
MariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAsMariaDB 10.11 key features overview for DBAs
MariaDB 10.11 key features overview for DBAs
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
 
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
 
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
 
Using all of the high availability options in MariaDB
Using all of the high availability options in MariaDBUsing all of the high availability options in MariaDB
Using all of the high availability options in MariaDB
 
Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
 
Upgrade to MySQL 8.0!
Upgrade to MySQL 8.0!Upgrade to MySQL 8.0!
Upgrade to MySQL 8.0!
 
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
MySQL Router REST API
MySQL Router REST APIMySQL Router REST API
MySQL Router REST API
 
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
 

Similar to 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
 

Similar to 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
 

Recently uploaded

Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
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
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 

Recently uploaded (20)

Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
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
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 

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.