Combining SQL and NoSQL with MySQL
[Pages:30]Combining SQL and NoSQL with MySQL
Manyi Lu Director MySQL Optimizer Team, Oracle April, 2018
CCooppyyrriigghhtt??22001164,,OOrraaccleleaanndd//oorrititssaafffiliilaiatteess..AAlllrrigighhttssrreesseerrvveedd..
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.
Copyright ? 2016, Oracle and/or its affiliates. All rights reserved.
2
Agenda
JSON data type
JSON functions Indexing JSON data Partial update of JSON
Copyright ? 2016, Oracle and/or its affiliates. All rights reserved.
3
The New JSON Datatype
? Validation on INSERT
CREATE TABLE employees (data JSON);
? No reparsing on SELECT
INSERT INTO employees VALUES
('{"id": 1, "name": "Jane"}'), ('{"id": 2, "name": "Joe"}');
? Optimized for read
? Dictionary of sorted keys
SELECT * FROM employees; +-------------------------------------+
?
Can compare JSON/SQL
| data
| ? Can convert JSON/SQL
+-------------------------------------+ ? Supports all native
| {"id": 1, "name": "Jane"}
| JSON datatypes
| {"id": 2, "name": "Joe"}
| ? Also supports date,
+-------------------------------------+ time, timestamp etc.
Copyright ? 2016, Oracle and/or its affiliates. All rights reserved.
4
Agenda
JSON data type
JSON functions
Indexing JSON data Partial update of JSON
Copyright ? 2016, Oracle and/or its affiliates. All rights reserved.
5
JSON Functions
MySQL 5.7 and 8.0
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[_PRESERVE]() JSON_OBJECT() JSON_QUOTE() JSON_REMOVE() JSON_REPLACE() JSON_SEARCH() JSON_SET() JSON_TYPE() JSON_UNQUOTE() JSON_VALID()
JSON_PRETTY() JSON_STORAGE_SIZE() JSON_STORAGE_FREE() JSON_ARRAYAGG() JSON_OBJECTAGG() JSON_MERGE_PATCH() JSON_TABLE()
Copyright ? 2016, Oracle and/or its affiliates. All rights reserved.
6
Inlined JSON Path Expressions
[[database.]table.]column->"$"
SELECT * FROM employees WHERE data->"$.name" = "Jane"; Is a short hand for SELECT * FROM employees WHERE JSON_EXTRACT(data, "$.name" ) = "Jane";
? SELECT * FROM employees WHERE data->'$.id'= 2; ? ALTER ... ADD COLUMN id INT AS (data->'$.id') ... ? CREATE VIEW .. AS SELECT data->'$.id', data->'$.name' FROM ...
Copyright ? 2016, Oracle and/or its affiliates. All rights reserved.
7
JSON_TABLE
? JSON is not limited to CRUD, can also be used in complex queries ? JSON_TABLE creates a relational view of JSON data
? Each object in a JSON array as a row ? JSON values within an JSON object as column values
? Query the result of JSON_TABLE() as a relational table using SQL ? Leverage existing framework for aggregation
Copyright ? 2016, Oracle and/or its affiliates. All rights reserved.
8
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- how to analyze json with sql snowflake inc
- importing and exporting net2 user data
- json integration in relational database systems
- combining sql and nosql with mysql
- dealing with json data in oracle dos and don ts
- enabling json document stores in relational systems
- experiences with json and xml transformations
- native json datatype support maturing sql and nosql
- working with json in rpg scott klement
Related searches
- roblox accounts and passwords with robux 2019
- roblox accounts and passwords with robux
- sql current date with format
- sql and python tutorial
- celtic knots and meanings with pictures
- sql case when with and
- 97110 and 97140 with modifiers
- sql basic commands with examples
- sql datetime format with milliseconds
- sql print statement with variables
- mac and cheese with eggs and milk
- sql print statement with select