SlideShare a Scribd company logo
1 of 69
Download to read offline
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1
Insert Picture Here
NoSQL атакует:
JSON функции
в MySQL сервере.
Света Смирнова
Ведущий инженер
https://twitter.com/#!/svetsmirnova
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.2
Содержание
 Введение: NoSQL в мире MySQL
 MySQL JSON функции
 Где их взять
 Взгляд в будущее
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.3
Insert Chart Here
Основные этапы
развития NoSQL
1997 1998 2000 2003 2004 2008 2009 2010 2012 2013
0
0.5
1
1.5
2
2.5
3
3.5
4
Databases
История NoSQL
NoSQL
database
NoSQL
term
db40 memcached
BigTable
MemcacheDB
Tarantool
CouchDB
MongoDB
Redis
WebSphere
Virtuoso
DynamoDB
JSON в
PostgreSQL
Hbase
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.4
Insert Chart Here
Появление NoSQL
возможностей в MySQL
2009
2010
2011
2012
2013
0
1
2
3
4
5
6
NoSQL в мире MySQL
Баги memcached
на mysql.com
HandlerSocket
InnoDB с memcached
Memcache API для
MySQL Cluster
NoSQL Connector
для JavaScript
EXPLAIN в JSON
Hadoop Applier
mysqlv8udfs
JSON UDFs
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.5
Insert Chart HereНакануне
2012
2013
2014
0
0.05
0.1
0.15
0.2
0.25
0.3
JSON функции в MySQL
Версия 0.1
Не была опубликована
Версия 0.2
Версия 0.3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.6
JSON функции
Функции
Манипуляции текстами в формате JSON
●
Валидация
●
Поиск
●
Модификация
UDF
●
Легко инсталлировать
●
Независимы от версии MySQL сервера
Работают на всех платформах, которые поддерживает MySQL
Бинарные дистрибутивы для Linux, Mac OSX 7 и Windows
Что они делают?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.9
Insert Picture Here
Что делают функции?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.10
json_valid(doc)
Проверяет является ли doc допустимым документом в формате
JSON.
Возвращает 1 если проверка прошла, 0 в противном случае.
Формат как описан на http://json.org,
http://www.ietf.org/rfc/rfc4627.txt?number=4627
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.11
json_valid(doc)
mysql> select json_valid('{"Devconf": ["conference", 
2014]}');
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| json_valid('{"Devconf": ["conference", 2014]}') |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
|                                               1 |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.01 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.12
json_valid(doc)
mysql> select json_valid('{"Devconf"}');
+­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| json_valid('{"Devconf"}') |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­+
|                         0 |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.13
json_contains_key(doc, keypart1, keypart2, ...)
Проверяет есть ли в документе указанный ключ
Возвращает 1 если элемент существует, 0 если нет и NULL если
документ не в формате JSON.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.14
json_contains_key(doc, keypart1, keypart2, ...)
SET optimizer_trace=1;
mysql> select user from mysql.user;
+­­­­­­+
...
mysql> select json_contains_key(trace, 'steps', '0', 
'join_optimization', 'steps', '0', 'condition_processing') as contains 
from information_schema.optimizer_trace;
+­­­­­­­­­­+
| contains |
+­­­­­­­­­­+
|        0 |
+­­­­­­­­­­+
1 row in set (0.01 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.15
json_contains_key(doc, keypart1, keypart2, ...)
mysql> select user from mysql.user where user='Sveta';
+­­­­­­+
...
mysql> select json_contains_key(trace, 'steps', '0', 
'join_optimization', 'steps', '0', 'condition_processing') as 
contains from information_schema.optimizer_trace;
+­­­­­­­­­­+
| contains |
+­­­­­­­­­­+
|        1 |
+­­­­­­­­­­+
1 row in set (0.01 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.16
json_extract(doc, keypart1, keypart2, ...)
Возвращает элемент по ключу или NULL если ключ не найден или
же документ не в формате JSON.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.17
json_extract(doc, keypart1, keypart2, ...)
SET optimizer_trace=1;
mysql> select user from mysql.user;
+­­­­­­+
...
mysql> select json_extract(trace, 'steps', '0', 'join_optimization', 
'steps', '0', 'condition_processing') as value from 
information_schema.optimizer_trace;
+­­­­­­­­­­+
| value    |
+­­­­­­­­­­+
|     NULL |
+­­­­­­­­­­+
1 row in set (0.01 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.18
Как выполняется поиск
{“steps”:
  [
    {“join_optimization”:
        {“steps”:
            [
              {“condition_processing”: .....
json_extract(trace, 'steps', '0', 'join_optimization', 
'steps', '0', 'condition_processing')
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.19
json_extract(doc, keypart1, keypart2, ...)
mysql> select user from mysql.user where user='Sveta';
+­­­­­­+
...
mysql> select json_extract(trace, 'steps', '0', 'join_optimization', 
'steps', '0', 'condition_processing') as value from 
information_schema.optimizer_traceG
*************************** 1. row ***************************
value: {
              "condition": "WHERE",
              "original_condition": "(`mysql`.`user`.`User` = 
'sveta')",
              "steps": [
....
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.20
json_append(doc, keypart1, keypart2, ...,
new_element)
Добавляет элемент в документ JSON.
Возвращает документ с добавленным элементом, оригинальный
документ, если некуда вставить элемент или NULL если документ,
либо подставляемое значение не в формате JSON.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.21
json_append(doc, keypart1, keypart2, ...,
new_element)
mysql> select json_append('{"Devconf": ["conference", 2014]}', 
'Devconf', 2, '" "') as 'Devconf';Москва
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                                           |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2014, " "]}       |Москва
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.22
json_append(doc, keypart1, keypart2, ...,
new_element)
mysql> select json_append('{"Devconf": 
["conference", 2014]}', 'Devconf', 1, '" "') as Москва
'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                           |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2014]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.23
json_replace(doc, keypart1, keypart2, ...,
new_value)
Обновляет значение по ключу.
Возвращает изменённый или оригинальный документ если ключ не
был найден, NULL если документ либо подставляемое значение не
в формате JSON.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.24
json_replace(doc, keypart1, keypart2, ...,
new_value)
mysql> select json_replace('{"Devconf": 
["conference", 2014]}', 'Devconf', '0', '"User 
conference"') as 'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                                |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["User conference", 2014]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.25
json_replace(doc, keypart1, keypart2, ...,
new_value)
mysql> select json_replace('{"Devconf": 
["conference", 2014]}', 'Devconf', '2', '"User 
conference"') as 'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                           |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2014]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.26
json_set(doc, keypart1, keypart2, ..., new_value)
Выполняет операцию наподобие INSERT ... ON DUPLICATE KEY
UPDATE.
Возвращает документ с добавленным или изменённым элементом,
NULL если документ либо подставляемое значение не в формате
JSON.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.27
json_set(doc, keypart1, keypart2, ..., new_value)
mysql> select json_set('{"Devconf": ["conference", 
2014]}', 'Devconf', '0', '"User conference"') as 
'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                                |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["User conference", 2014]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.28
json_set(doc, keypart1, keypart2, ..., new_value)
mysql> select json_set('{"Devconf": ["conference", 
2014]}', 'Devconf', '2', '" "') as 'Devconf';Москва
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                                     |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2014, " "]} |Москва
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.29
json_remove(doc, keypart1, keypart2, ...)
Удаляет элемент.
Возвращает документ без элемента, оригинальный документ, если
ключ не найден или NULL если документ не в формате JSON.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.30
json_remove(doc, keypart1, keypart2, ...)
mysql> select json_remove('{"Devconf": 
["conference", 2014]}', 'Devconf', '1') as 
'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                     |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference"]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.31
json_remove(doc, keypart1, keypart2, ...)
mysql> select json_remove('{"Devconf": 
["conference", 2014]}', 'Devconf', '2') as 
'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                           |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2014]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.32
json_search(doc, value)
Осуществляет поиск по значению.
Возвращает путь к найденному элементу в обратном порядке,
NULL если элемент не найден или документ не в формате JSON.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.33
json_search(doc, value)
mysql> select json_search(trace, '"trivial_condition_removal"') from 
information_schema.optimizer_trace;
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| json_search(trace, '"trivial_condition_removal"')                              |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
|transformation:0:steps:condition_processing:0:steps:join_optimization:0:steps:: |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.34
json_search(doc, value)
mysql> select json_search(trace, '"trivial_condition"') 
from information_schema.optimizer_trace;
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| json_search(trace, '"trivial_condition"') |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| NULL                                      |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.01 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.35
json_search(doc, value)
mysql> select json_search('{"Devconf": ["conference", 2014]}', 
'"conf%"');
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| json_search('{"Devconf": ["conference", 2014]}', '"conf%"') |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| 0:Devconf::                                                 |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Feature preview!
0.3.2+
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.36
json_merge(doc1, doc2, ...)
Объединяет два или более документов в один.
Возвращает первый документ с присоединёнными последующими.
Дубликаты ключей никак не обрабатываются.
Внимание! Эта функция не проверяет документы на соответствие
формату JSON.
Тем не менее открывающие и закрывающие скобки у всех
документов должны совпадать.
Возвращает NULL если у первого документа нет открывающих-
закрывающих скобок или же они не совпадают.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.37
json_safe_merge(doc1, doc2, ...)
Объединяет два или более документов в один.
Возвращает первый документ с присоединёнными последующими.
Дубликаты ключей никак не обрабатываются.
Внимание! Эта функция проверяет все документы на соответствие
формату JSON.
Возвращает NULL если первый документ не в формате JSON.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.38
json_deep_merge(doc1, doc2, ...)
Объединяет два или более документов в один.
Возвращает первый документ с присоединёнными последующими.
Значения дублирующих ключей обновляются.
Внимание! Эта функция проверяет все документы на соответствие
формату JSON.
Возвращает NULL если у первый документ не в формате JSON.
Feature preview!
0.3.2+
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.39
json_merge(doc1, doc2, ...)
mysql> select json_merge('{"Devconf": ["conference", 2013]}', 
'{"Devconf": ["conference", 2014]}') as 'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                                                            |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2013], "Devconf": ["conference", 2014]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.40
json_safe_merge(doc1, doc2, ...)
mysql> select json_safe_merge('{"Devconf": ["conference", 2013]}', 
'{"Devconf": ["conference", 2014]}') as 'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                                                            |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2013], "Devconf": ["conference", 2014]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.41
json_deep_merge(doc1, doc2, ...)
mysql> select json_deep_merge('{"Devconf": ["conference", 
2013]}', '{"Devconf": ["conference", 2014]}') as 
'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                                               |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2013, "conference", 2014]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Feature preview!
0.3.2+
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.42
json_merge(doc1, doc2, ...)
mysql> select json_merge('{"Devconf": ["conference", 2013]}', 
'{"Devconf": ["conference", 2014]}', '1') as 'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                                                            |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2013], "Devconf": ["conference", 2014]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.43
json_merge(doc1, doc2, ...)
mysql> select json_merge('{"Devconf": ["conference", 2013]}', 
'{"Devconf": ["conference" 2014]}') as 'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                                                           |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2013], "Devconf": ["conference" 2014]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.44
json_safe_merge(doc1, doc2, ...)
mysql> select json_safe_merge('{"Devconf": 
["conference", 2013]}', 
­> '{"Devconf": ["conference" 2014]}') as 'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                           |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2013]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.45
json_deep_merge(doc1, doc2, ...)
mysql> select json_deep_merge('{"Devconf": 
["conference", 2013]}', 
­>'{"Devconf": ["conference" 2014]}') as 'Devconf';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Devconf                           |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| {"Devconf": ["conference", 2013]} |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Feature preview!
0.3.2+
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.46
json_depth(doc)
Возвращает количество уровней вложения в документе или NULL
если документ не в формате JSON
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.47
json_depth(doc)
mysql> select json_depth('{"Devconf": ["conference", 
2014]}');
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| json_depth('{"Devconf": ["conference", 2014]}') |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
|                                               3 |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.48
json_count(doc[, keypart1[, keypart2[, ...]]])
Возвращает количество детей родительского элемента, указанного
при помощи пути, корневого элемента если путь опущен или NULL
если документ не в формате JSON
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.49
json_count(doc, keypart1, keypart2, ...)
mysql> select json_count('{"Devconf": ["conference", 
2014]}');
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| json_count('{"Devconf": ["conference", 2014]}') |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
|                                               1 |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.50
json_count(doc, keypart1, keypart2, ...)
mysql> select json_count('{"Devconf": ["conference", 2014]}', 
'Devconf');
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| json_count('{"Devconf": ["conference", 2014]}', 'Devconf') |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
|                                                          2 |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.51
json_version()
Возвращает версию функций.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.52
json_version()
mysql> select json_version();
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| json_version()             |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| MySQL JSON UDFs 0.3.2­labs |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.53
json_test_parser(doc)
Возвращает текстовое представление parse tree документа JSON,
частичное дерево или пустую строку если документ не в формате
JSON.
Эта функция предназначена исключительно для тестирования и не
должна использоваться в рабочем приложении.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.54
json_test_parser(doc)
mysql> select json_test_parser('{"Devconf": 
["conference", 2014]}') as 'Parse tree'G
********************** 1. row **********************
Parse tree:  => "conference";
             => 2014;
         "Devconf" => ["conference", 2014];
       => {"Devconf": ["conference", 2014]};
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.55
json_test_parser(doc)
mysql> select json_test_parser('{"Devconf": ["conference", 
2014]') as 'Parse tree';
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| Parse tree                                                   |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
|  => "conference"; => 2014;"Devconf" => ["conference", 2014]; |
+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
1 row in set (0.00 sec)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.56
Insert Picture Here
Где взять?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.57
Исходный код и бинарные дистрибутивы
MySQL Labs
●
Исходный код
●
Бинарные дистрибутивы
●
x86 and x86_64
●
Generic Linux
●
Mac OSX 10.7
●
Windows 7
●
http://labs.mysql.com/
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.58
Как инсталлировать?
UNIX
create function json_valid returns integer
soname 'libmy_json_udf.so';
create function json_search returns string
soname 'libmy_json_udf.so';
create function json_extract returns string
soname 'libmy_json_udf.so';
create function json_replace returns string
soname 'libmy_json_udf.so';
create function json_append returns string
soname 'libmy_json_udf.so';
...
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.59
Как инсталлировать?
Windows
create function json_remove returns string 
soname 'my_json_udf.dll';
create function json_set returns string 
soname 'my_json_udf.dll';
create function json_merge returns string 
soname 'my_json_udf.dll';
create function json_contains_key returns integer
soname 'my_json_udf.dll';
create function json_test_parser returns string
soname 'my_json_udf.dll';
...
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.60
Как инсталлировать или удалить?
Готовые скрипты
mysql db_name < install_jsonudf.sql 
mysql db_name < uninstall_jsonudf.sql
Спасибо Daniel van Eeden! 
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.61
Зависимости
Библиотека Regex
Распространяется вместе с дистрибутивом функций
UNIX
●
Можно использовать системную
Windows
●
Всегда компилируется статически
Вам не нужно устанавливать никаких библиотек, чтобы
использовать функции!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.62
Как компилировать?
UNIX
Вам нужно:
●
cmake
●
Regex library (поставляется вместе с исходниками)
●
Компилятор
Как скомпилировать:
●
cmake . ­DMYSQL_DIR=/home/sveta/build/mysql­5.6
●
make
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.63
Как компилировать?
Windows
Вам нужно:
●
PCRE (поставляется вместе с исходным кодом)
●
Visual Studio
●
cmake (cmake.org)
Чтобы собрать JSON UDF:
●
"C:Program Files (x86)CMake 2.8bincmake.exe" ­G 
"Visual Studio 11 Win64" . ­DMYSQL_DIR="C:/MySQL/mysql­
5.6.19"
●
devenv my_json_udf.sln /build Release
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.64
Больше информации
Документация и статьи
●
Файл README
●
Мой блог: https://blogs.oracle.com/svetasmirnova/
Анонсы
●
Мой twitter: https://twitter.com/#!/svetsmirnova
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.65
Insert Picture Here
Будущее
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.66
Зависит от вас
Открывайте баги
Шлите предложения по улучшению
Больше вы пришлёте – больше мы сделаем
Сейчас вы можете влиять на решения
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.67
Куда посылать баги и feature request-ы
MySQL Community bugs database
●
https://bugs.mysql.com/
●
Категория
●
“MySQL Server: JSON User-defined function (UDF)”
Internal Oracle bugs database
●
Просите инженеров технической поддержки MySQL открыть баг репорт
для вас
●
Категория “UDFJSON”
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.68
Полезные ссылки
https://blogs.oracle.com/svetasmirnova/
https://twitter.com/#!/svetsmirnova
http://json.org/
http://www.pcre.org/
http://dev.mysql.com/doc/refman/5.6/en/adding-functions.html
http://bugs.mysql.com/
https://support.oracle.com
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.69
Insert Picture Here
?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.70
Insert Picture Here
СПАСИБО!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.71
The preceding 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.

More Related Content

What's hot

Introduction to XtraDB Cluster
Introduction to XtraDB ClusterIntroduction to XtraDB Cluster
Introduction to XtraDB Clusteryoku0825
 
Build an affordable Cloud Stroage
Build an affordable Cloud StroageBuild an affordable Cloud Stroage
Build an affordable Cloud StroageAlex Lau
 
Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016StackIQ
 
Aerospike DB and Storm for real-time analytics
Aerospike DB and Storm for real-time analyticsAerospike DB and Storm for real-time analytics
Aerospike DB and Storm for real-time analyticsAerospike
 
Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响maclean liu
 
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기Ji-Woong Choi
 
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-AsibleTommy Lee
 
Performance analysis with_ceph
Performance analysis with_cephPerformance analysis with_ceph
Performance analysis with_cephAlex Lau
 
제2회난공불락 오픈소스 세미나 커널튜닝
제2회난공불락 오픈소스 세미나 커널튜닝제2회난공불락 오픈소스 세미나 커널튜닝
제2회난공불락 오픈소스 세미나 커널튜닝Tommy Lee
 
HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)akirahiguchi
 
jcmd #javacasual
jcmd #javacasualjcmd #javacasual
jcmd #javacasualYuji Kubota
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKI Goo Lee
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network TroubleshootingOpen Source Consulting
 
HandlerSocket - A NoSQL plugin for MySQL
HandlerSocket - A NoSQL plugin for MySQLHandlerSocket - A NoSQL plugin for MySQL
HandlerSocket - A NoSQL plugin for MySQLJui-Nan Lin
 
Ceph Performance and Sizing Guide
Ceph Performance and Sizing GuideCeph Performance and Sizing Guide
Ceph Performance and Sizing GuideJose De La Rosa
 
Spider Setup with AWS/sandbox
Spider Setup with AWS/sandboxSpider Setup with AWS/sandbox
Spider Setup with AWS/sandboxI Goo Lee
 
SUSE Enterprise Storage on ThunderX
SUSE Enterprise Storage on ThunderXSUSE Enterprise Storage on ThunderX
SUSE Enterprise Storage on ThunderXAlex Lau
 
Ceph Day Bring Ceph To Enterprise
Ceph Day Bring Ceph To EnterpriseCeph Day Bring Ceph To Enterprise
Ceph Day Bring Ceph To EnterpriseAlex Lau
 
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库maclean liu
 

What's hot (20)

Introduction to XtraDB Cluster
Introduction to XtraDB ClusterIntroduction to XtraDB Cluster
Introduction to XtraDB Cluster
 
Build an affordable Cloud Stroage
Build an affordable Cloud StroageBuild an affordable Cloud Stroage
Build an affordable Cloud Stroage
 
Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016
 
Aerospike DB and Storm for real-time analytics
Aerospike DB and Storm for real-time analyticsAerospike DB and Storm for real-time analytics
Aerospike DB and Storm for real-time analytics
 
Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响Vbox virtual box在oracle linux 5 - shoug 梁洪响
Vbox virtual box在oracle linux 5 - shoug 梁洪响
 
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
 
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible
 
Performance analysis with_ceph
Performance analysis with_cephPerformance analysis with_ceph
Performance analysis with_ceph
 
제2회난공불락 오픈소스 세미나 커널튜닝
제2회난공불락 오픈소스 세미나 커널튜닝제2회난공불락 오픈소스 세미나 커널튜닝
제2회난공불락 오픈소스 세미나 커널튜닝
 
HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)HandlerSocket plugin for MySQL (English)
HandlerSocket plugin for MySQL (English)
 
jcmd #javacasual
jcmd #javacasualjcmd #javacasual
jcmd #javacasual
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
Curso de MySQL 5.7
Curso de MySQL 5.7Curso de MySQL 5.7
Curso de MySQL 5.7
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting
 
HandlerSocket - A NoSQL plugin for MySQL
HandlerSocket - A NoSQL plugin for MySQLHandlerSocket - A NoSQL plugin for MySQL
HandlerSocket - A NoSQL plugin for MySQL
 
Ceph Performance and Sizing Guide
Ceph Performance and Sizing GuideCeph Performance and Sizing Guide
Ceph Performance and Sizing Guide
 
Spider Setup with AWS/sandbox
Spider Setup with AWS/sandboxSpider Setup with AWS/sandbox
Spider Setup with AWS/sandbox
 
SUSE Enterprise Storage on ThunderX
SUSE Enterprise Storage on ThunderXSUSE Enterprise Storage on ThunderX
SUSE Enterprise Storage on ThunderX
 
Ceph Day Bring Ceph To Enterprise
Ceph Day Bring Ceph To EnterpriseCeph Day Bring Ceph To Enterprise
Ceph Day Bring Ceph To Enterprise
 
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
 

Viewers also liked

Final race-condition-in-the-web
Final race-condition-in-the-webFinal race-condition-in-the-web
Final race-condition-in-the-webXchym Hiệp
 
04 ос взаимодействие_процессов_1
04 ос взаимодействие_процессов_104 ос взаимодействие_процессов_1
04 ос взаимодействие_процессов_1921519
 
4.3. Rat races conditions
4.3. Rat races conditions4.3. Rat races conditions
4.3. Rat races conditionsdefconmoscow
 
анализ кода: от проверки стиля до автоматического тестирования
анализ кода: от проверки стиля до автоматического тестированияанализ кода: от проверки стиля до автоматического тестирования
анализ кода: от проверки стиля до автоматического тестированияRuslan Shevchenko
 
TMPA-2015: The Application of Static Analysis to Optimize the Dynamic Detecti...
TMPA-2015: The Application of Static Analysis to Optimize the Dynamic Detecti...TMPA-2015: The Application of Static Analysis to Optimize the Dynamic Detecti...
TMPA-2015: The Application of Static Analysis to Optimize the Dynamic Detecti...Iosif Itkin
 

Viewers also liked (8)

Final race-condition-in-the-web
Final race-condition-in-the-webFinal race-condition-in-the-web
Final race-condition-in-the-web
 
04 ос взаимодействие_процессов_1
04 ос взаимодействие_процессов_104 ос взаимодействие_процессов_1
04 ос взаимодействие_процессов_1
 
IT Race 2014
IT Race 2014IT Race 2014
IT Race 2014
 
4.3. Rat races conditions
4.3. Rat races conditions4.3. Rat races conditions
4.3. Rat races conditions
 
анализ кода: от проверки стиля до автоматического тестирования
анализ кода: от проверки стиля до автоматического тестированияанализ кода: от проверки стиля до автоматического тестирования
анализ кода: от проверки стиля до автоматического тестирования
 
Race condition
Race conditionRace condition
Race condition
 
TMPA-2015: The Application of Static Analysis to Optimize the Dynamic Detecti...
TMPA-2015: The Application of Static Analysis to Optimize the Dynamic Detecti...TMPA-2015: The Application of Static Analysis to Optimize the Dynamic Detecti...
TMPA-2015: The Application of Static Analysis to Optimize the Dynamic Detecti...
 
Linux IPC
Linux IPCLinux IPC
Linux IPC
 

Similar to NoSQL атакует: JSON функции в MySQL сервере.

Second Step to the NoSQL Side: MySQL JSON Functions
Second Step to the NoSQL Side: MySQL JSON FunctionsSecond Step to the NoSQL Side: MySQL JSON Functions
Second Step to the NoSQL Side: MySQL JSON FunctionsSveta Smirnova
 
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Oracle Developers
 
Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)Logico
 
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersBruno Borges
 
NoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSONNoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSONMario Beck
 
[OSC 2020 Online/Nagoya] MySQLドキュメントストア
[OSC 2020 Online/Nagoya] MySQLドキュメントストア[OSC 2020 Online/Nagoya] MySQLドキュメントストア
[OSC 2020 Online/Nagoya] MySQLドキュメントストアRyusuke Kajiyama
 
MySQL Tech Café #8: MySQL 8.0 for Python Developers
MySQL Tech Café #8: MySQL 8.0 for Python DevelopersMySQL Tech Café #8: MySQL 8.0 for Python Developers
MySQL Tech Café #8: MySQL 8.0 for Python DevelopersFrederic Descamps
 
JDBC Next: A New Asynchronous API for Connecting to a Database
JDBC Next: A New Asynchronous API for Connecting to a Database JDBC Next: A New Asynchronous API for Connecting to a Database
JDBC Next: A New Asynchronous API for Connecting to a Database Yolande Poirier
 
Optimizer percona live_ams2015
Optimizer percona live_ams2015Optimizer percona live_ams2015
Optimizer percona live_ams2015Manyi Lu
 
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDS
Cloud native -  Why to use MySQL 8.0 and how to use it on oci with MDSCloud native -  Why to use MySQL 8.0 and how to use it on oci with MDS
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDSFrederic Descamps
 
20161029 py con-mysq-lv3
20161029 py con-mysq-lv320161029 py con-mysq-lv3
20161029 py con-mysq-lv3Ivan Ma
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gMarcelo Ochoa
 
Squeak DBX
Squeak DBXSqueak DBX
Squeak DBXESUG
 
Generic Parse Server
Generic Parse ServerGeneric Parse Server
Generic Parse Serverdavidolesch
 
Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Oracle Developers
 

Similar to NoSQL атакует: JSON функции в MySQL сервере. (20)

Second Step to the NoSQL Side: MySQL JSON Functions
Second Step to the NoSQL Side: MySQL JSON FunctionsSecond Step to the NoSQL Side: MySQL JSON Functions
Second Step to the NoSQL Side: MySQL JSON Functions
 
MySQL JSON Functions
MySQL JSON FunctionsMySQL JSON Functions
MySQL JSON Functions
 
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
 
Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)
 
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c Developers
 
NoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSONNoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSON
 
[OSC 2020 Online/Nagoya] MySQLドキュメントストア
[OSC 2020 Online/Nagoya] MySQLドキュメントストア[OSC 2020 Online/Nagoya] MySQLドキュメントストア
[OSC 2020 Online/Nagoya] MySQLドキュメントストア
 
ROracle
ROracle ROracle
ROracle
 
MySQL Tech Café #8: MySQL 8.0 for Python Developers
MySQL Tech Café #8: MySQL 8.0 for Python DevelopersMySQL Tech Café #8: MySQL 8.0 for Python Developers
MySQL Tech Café #8: MySQL 8.0 for Python Developers
 
JDBC Next: A New Asynchronous API for Connecting to a Database
JDBC Next: A New Asynchronous API for Connecting to a Database JDBC Next: A New Asynchronous API for Connecting to a Database
JDBC Next: A New Asynchronous API for Connecting to a Database
 
Optimizer percona live_ams2015
Optimizer percona live_ams2015Optimizer percona live_ams2015
Optimizer percona live_ams2015
 
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDS
Cloud native -  Why to use MySQL 8.0 and how to use it on oci with MDSCloud native -  Why to use MySQL 8.0 and how to use it on oci with MDS
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDS
 
20161029 py con-mysq-lv3
20161029 py con-mysq-lv320161029 py con-mysq-lv3
20161029 py con-mysq-lv3
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11g
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
Squeak DBX
Squeak DBXSqueak DBX
Squeak DBX
 
Generic Parse Server
Generic Parse ServerGeneric Parse Server
Generic Parse Server
 
Java ee7 1hour
Java ee7 1hourJava ee7 1hour
Java ee7 1hour
 
Cassandra: Now and the Future @ Yahoo! JAPAN
Cassandra: Now and the Future @ Yahoo! JAPANCassandra: Now and the Future @ Yahoo! JAPAN
Cassandra: Now and the Future @ Yahoo! JAPAN
 
Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018
 

More from Sveta Smirnova

Database in Kubernetes: Diagnostics and Monitoring
Database in Kubernetes: Diagnostics and MonitoringDatabase in Kubernetes: Diagnostics and Monitoring
Database in Kubernetes: Diagnostics and MonitoringSveta Smirnova
 
MySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to HaveMySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to HaveSveta Smirnova
 
MySQL Cookbook: Recipes for Developers
MySQL Cookbook: Recipes for DevelopersMySQL Cookbook: Recipes for Developers
MySQL Cookbook: Recipes for DevelopersSveta Smirnova
 
MySQL Performance for DevOps
MySQL Performance for DevOpsMySQL Performance for DevOps
MySQL Performance for DevOpsSveta Smirnova
 
MySQL Test Framework для поддержки клиентов и верификации багов
MySQL Test Framework для поддержки клиентов и верификации баговMySQL Test Framework для поддержки клиентов и верификации багов
MySQL Test Framework для поддержки клиентов и верификации баговSveta Smirnova
 
MySQL Cookbook: Recipes for Your Business
MySQL Cookbook: Recipes for Your BusinessMySQL Cookbook: Recipes for Your Business
MySQL Cookbook: Recipes for Your BusinessSveta Smirnova
 
Introduction into MySQL Query Tuning for Dev[Op]s
Introduction into MySQL Query Tuning for Dev[Op]sIntroduction into MySQL Query Tuning for Dev[Op]s
Introduction into MySQL Query Tuning for Dev[Op]sSveta Smirnova
 
Производительность MySQL для DevOps
 Производительность MySQL для DevOps Производительность MySQL для DevOps
Производительность MySQL для DevOpsSveta Smirnova
 
MySQL Performance for DevOps
MySQL Performance for DevOpsMySQL Performance for DevOps
MySQL Performance for DevOpsSveta Smirnova
 
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterHow to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterSveta Smirnova
 
How to migrate from MySQL to MariaDB without tears
How to migrate from MySQL to MariaDB without tearsHow to migrate from MySQL to MariaDB without tears
How to migrate from MySQL to MariaDB without tearsSveta Smirnova
 
Modern solutions for modern database load: improvements in the latest MariaDB...
Modern solutions for modern database load: improvements in the latest MariaDB...Modern solutions for modern database load: improvements in the latest MariaDB...
Modern solutions for modern database load: improvements in the latest MariaDB...Sveta Smirnova
 
How Safe is Asynchronous Master-Master Setup?
How Safe is Asynchronous Master-Master Setup?How Safe is Asynchronous Master-Master Setup?
How Safe is Asynchronous Master-Master Setup?Sveta Smirnova
 
Современному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
Современному хайлоду - современные решения: MySQL 8.0 и улучшения PerconaСовременному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
Современному хайлоду - современные решения: MySQL 8.0 и улучшения PerconaSveta Smirnova
 
How to Avoid Pitfalls in Schema Upgrade with Galera
How to Avoid Pitfalls in Schema Upgrade with GaleraHow to Avoid Pitfalls in Schema Upgrade with Galera
How to Avoid Pitfalls in Schema Upgrade with GaleraSveta Smirnova
 
How Safe is Asynchronous Master-Master Setup?
 How Safe is Asynchronous Master-Master Setup? How Safe is Asynchronous Master-Master Setup?
How Safe is Asynchronous Master-Master Setup?Sveta Smirnova
 
Introduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]sIntroduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]sSveta Smirnova
 
Billion Goods in Few Categories: How Histograms Save a Life?
Billion Goods in Few Categories: How Histograms Save a Life?Billion Goods in Few Categories: How Histograms Save a Life?
Billion Goods in Few Categories: How Histograms Save a Life?Sveta Smirnova
 
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...Sveta Smirnova
 
Что нужно знать о трёх топовых фичах MySQL
Что нужно знать  о трёх топовых фичах  MySQLЧто нужно знать  о трёх топовых фичах  MySQL
Что нужно знать о трёх топовых фичах MySQLSveta Smirnova
 

More from Sveta Smirnova (20)

Database in Kubernetes: Diagnostics and Monitoring
Database in Kubernetes: Diagnostics and MonitoringDatabase in Kubernetes: Diagnostics and Monitoring
Database in Kubernetes: Diagnostics and Monitoring
 
MySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to HaveMySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to Have
 
MySQL Cookbook: Recipes for Developers
MySQL Cookbook: Recipes for DevelopersMySQL Cookbook: Recipes for Developers
MySQL Cookbook: Recipes for Developers
 
MySQL Performance for DevOps
MySQL Performance for DevOpsMySQL Performance for DevOps
MySQL Performance for DevOps
 
MySQL Test Framework для поддержки клиентов и верификации багов
MySQL Test Framework для поддержки клиентов и верификации баговMySQL Test Framework для поддержки клиентов и верификации багов
MySQL Test Framework для поддержки клиентов и верификации багов
 
MySQL Cookbook: Recipes for Your Business
MySQL Cookbook: Recipes for Your BusinessMySQL Cookbook: Recipes for Your Business
MySQL Cookbook: Recipes for Your Business
 
Introduction into MySQL Query Tuning for Dev[Op]s
Introduction into MySQL Query Tuning for Dev[Op]sIntroduction into MySQL Query Tuning for Dev[Op]s
Introduction into MySQL Query Tuning for Dev[Op]s
 
Производительность MySQL для DevOps
 Производительность MySQL для DevOps Производительность MySQL для DevOps
Производительность MySQL для DevOps
 
MySQL Performance for DevOps
MySQL Performance for DevOpsMySQL Performance for DevOps
MySQL Performance for DevOps
 
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterHow to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
 
How to migrate from MySQL to MariaDB without tears
How to migrate from MySQL to MariaDB without tearsHow to migrate from MySQL to MariaDB without tears
How to migrate from MySQL to MariaDB without tears
 
Modern solutions for modern database load: improvements in the latest MariaDB...
Modern solutions for modern database load: improvements in the latest MariaDB...Modern solutions for modern database load: improvements in the latest MariaDB...
Modern solutions for modern database load: improvements in the latest MariaDB...
 
How Safe is Asynchronous Master-Master Setup?
How Safe is Asynchronous Master-Master Setup?How Safe is Asynchronous Master-Master Setup?
How Safe is Asynchronous Master-Master Setup?
 
Современному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
Современному хайлоду - современные решения: MySQL 8.0 и улучшения PerconaСовременному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
Современному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
 
How to Avoid Pitfalls in Schema Upgrade with Galera
How to Avoid Pitfalls in Schema Upgrade with GaleraHow to Avoid Pitfalls in Schema Upgrade with Galera
How to Avoid Pitfalls in Schema Upgrade with Galera
 
How Safe is Asynchronous Master-Master Setup?
 How Safe is Asynchronous Master-Master Setup? How Safe is Asynchronous Master-Master Setup?
How Safe is Asynchronous Master-Master Setup?
 
Introduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]sIntroduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]s
 
Billion Goods in Few Categories: How Histograms Save a Life?
Billion Goods in Few Categories: How Histograms Save a Life?Billion Goods in Few Categories: How Histograms Save a Life?
Billion Goods in Few Categories: How Histograms Save a Life?
 
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
 
Что нужно знать о трёх топовых фичах MySQL
Что нужно знать  о трёх топовых фичах  MySQLЧто нужно знать  о трёх топовых фичах  MySQL
Что нужно знать о трёх топовых фичах MySQL
 

Recently uploaded

JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdfMeon Technology
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native BuildpacksVish Abrams
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyRaymond Okyere-Forson
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageDista
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?AmeliaSmith90
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesShyamsundar Das
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorShane Coughlan
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxJoão Esperancinha
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptkinjal48
 

Recently uploaded (20)

JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdf
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native Buildpacks
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human Beauty
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in Trivandrum
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security Challenges
 
Salesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptxSalesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptx
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS Calculator
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptx
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.ppt
 

NoSQL атакует: JSON функции в MySQL сервере.

  • 1. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1 Insert Picture Here NoSQL атакует: JSON функции в MySQL сервере. Света Смирнова Ведущий инженер https://twitter.com/#!/svetsmirnova
  • 2. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.2 Содержание  Введение: NoSQL в мире MySQL  MySQL JSON функции  Где их взять  Взгляд в будущее
  • 3. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.3 Insert Chart Here Основные этапы развития NoSQL 1997 1998 2000 2003 2004 2008 2009 2010 2012 2013 0 0.5 1 1.5 2 2.5 3 3.5 4 Databases История NoSQL NoSQL database NoSQL term db40 memcached BigTable MemcacheDB Tarantool CouchDB MongoDB Redis WebSphere Virtuoso DynamoDB JSON в PostgreSQL Hbase
  • 4. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.4 Insert Chart Here Появление NoSQL возможностей в MySQL 2009 2010 2011 2012 2013 0 1 2 3 4 5 6 NoSQL в мире MySQL Баги memcached на mysql.com HandlerSocket InnoDB с memcached Memcache API для MySQL Cluster NoSQL Connector для JavaScript EXPLAIN в JSON Hadoop Applier mysqlv8udfs JSON UDFs
  • 5. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.5 Insert Chart HereНакануне 2012 2013 2014 0 0.05 0.1 0.15 0.2 0.25 0.3 JSON функции в MySQL Версия 0.1 Не была опубликована Версия 0.2 Версия 0.3
  • 6. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.6 JSON функции Функции Манипуляции текстами в формате JSON ● Валидация ● Поиск ● Модификация UDF ● Легко инсталлировать ● Независимы от версии MySQL сервера Работают на всех платформах, которые поддерживает MySQL Бинарные дистрибутивы для Linux, Mac OSX 7 и Windows Что они делают?
  • 7. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.9 Insert Picture Here Что делают функции?
  • 8. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.10 json_valid(doc) Проверяет является ли doc допустимым документом в формате JSON. Возвращает 1 если проверка прошла, 0 в противном случае. Формат как описан на http://json.org, http://www.ietf.org/rfc/rfc4627.txt?number=4627
  • 9. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.11 json_valid(doc) mysql> select json_valid('{"Devconf": ["conference",  2014]}'); +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | json_valid('{"Devconf": ["conference", 2014]}') | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ |                                               1 | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.01 sec)
  • 10. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.12 json_valid(doc) mysql> select json_valid('{"Devconf"}'); +­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | json_valid('{"Devconf"}') | +­­­­­­­­­­­­­­­­­­­­­­­­­­­+ |                         0 | +­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 11. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.13 json_contains_key(doc, keypart1, keypart2, ...) Проверяет есть ли в документе указанный ключ Возвращает 1 если элемент существует, 0 если нет и NULL если документ не в формате JSON.
  • 12. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.14 json_contains_key(doc, keypart1, keypart2, ...) SET optimizer_trace=1; mysql> select user from mysql.user; +­­­­­­+ ... mysql> select json_contains_key(trace, 'steps', '0',  'join_optimization', 'steps', '0', 'condition_processing') as contains  from information_schema.optimizer_trace; +­­­­­­­­­­+ | contains | +­­­­­­­­­­+ |        0 | +­­­­­­­­­­+ 1 row in set (0.01 sec)
  • 13. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.15 json_contains_key(doc, keypart1, keypart2, ...) mysql> select user from mysql.user where user='Sveta'; +­­­­­­+ ... mysql> select json_contains_key(trace, 'steps', '0',  'join_optimization', 'steps', '0', 'condition_processing') as  contains from information_schema.optimizer_trace; +­­­­­­­­­­+ | contains | +­­­­­­­­­­+ |        1 | +­­­­­­­­­­+ 1 row in set (0.01 sec)
  • 14. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.16 json_extract(doc, keypart1, keypart2, ...) Возвращает элемент по ключу или NULL если ключ не найден или же документ не в формате JSON.
  • 15. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.17 json_extract(doc, keypart1, keypart2, ...) SET optimizer_trace=1; mysql> select user from mysql.user; +­­­­­­+ ... mysql> select json_extract(trace, 'steps', '0', 'join_optimization',  'steps', '0', 'condition_processing') as value from  information_schema.optimizer_trace; +­­­­­­­­­­+ | value    | +­­­­­­­­­­+ |     NULL | +­­­­­­­­­­+ 1 row in set (0.01 sec)
  • 16. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.18 Как выполняется поиск {“steps”:   [     {“join_optimization”:         {“steps”:             [               {“condition_processing”: ..... json_extract(trace, 'steps', '0', 'join_optimization',  'steps', '0', 'condition_processing')
  • 17. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.19 json_extract(doc, keypart1, keypart2, ...) mysql> select user from mysql.user where user='Sveta'; +­­­­­­+ ... mysql> select json_extract(trace, 'steps', '0', 'join_optimization',  'steps', '0', 'condition_processing') as value from  information_schema.optimizer_traceG *************************** 1. row *************************** value: {               "condition": "WHERE",               "original_condition": "(`mysql`.`user`.`User` =  'sveta')",               "steps": [ ....
  • 18. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.20 json_append(doc, keypart1, keypart2, ..., new_element) Добавляет элемент в документ JSON. Возвращает документ с добавленным элементом, оригинальный документ, если некуда вставить элемент или NULL если документ, либо подставляемое значение не в формате JSON.
  • 19. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.21 json_append(doc, keypart1, keypart2, ..., new_element) mysql> select json_append('{"Devconf": ["conference", 2014]}',  'Devconf', 2, '" "') as 'Devconf';Москва +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                                           | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2014, " "]}       |Москва +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 20. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.22 json_append(doc, keypart1, keypart2, ..., new_element) mysql> select json_append('{"Devconf":  ["conference", 2014]}', 'Devconf', 1, '" "') as Москва 'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                           | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2014]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 21. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.23 json_replace(doc, keypart1, keypart2, ..., new_value) Обновляет значение по ключу. Возвращает изменённый или оригинальный документ если ключ не был найден, NULL если документ либо подставляемое значение не в формате JSON.
  • 22. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.24 json_replace(doc, keypart1, keypart2, ..., new_value) mysql> select json_replace('{"Devconf":  ["conference", 2014]}', 'Devconf', '0', '"User  conference"') as 'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                                | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["User conference", 2014]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 23. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.25 json_replace(doc, keypart1, keypart2, ..., new_value) mysql> select json_replace('{"Devconf":  ["conference", 2014]}', 'Devconf', '2', '"User  conference"') as 'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                           | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2014]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 24. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.26 json_set(doc, keypart1, keypart2, ..., new_value) Выполняет операцию наподобие INSERT ... ON DUPLICATE KEY UPDATE. Возвращает документ с добавленным или изменённым элементом, NULL если документ либо подставляемое значение не в формате JSON.
  • 25. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.27 json_set(doc, keypart1, keypart2, ..., new_value) mysql> select json_set('{"Devconf": ["conference",  2014]}', 'Devconf', '0', '"User conference"') as  'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                                | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["User conference", 2014]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 26. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.28 json_set(doc, keypart1, keypart2, ..., new_value) mysql> select json_set('{"Devconf": ["conference",  2014]}', 'Devconf', '2', '" "') as 'Devconf';Москва +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                                     | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2014, " "]} |Москва +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 27. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.29 json_remove(doc, keypart1, keypart2, ...) Удаляет элемент. Возвращает документ без элемента, оригинальный документ, если ключ не найден или NULL если документ не в формате JSON.
  • 28. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.30 json_remove(doc, keypart1, keypart2, ...) mysql> select json_remove('{"Devconf":  ["conference", 2014]}', 'Devconf', '1') as  'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                     | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference"]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 29. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.31 json_remove(doc, keypart1, keypart2, ...) mysql> select json_remove('{"Devconf":  ["conference", 2014]}', 'Devconf', '2') as  'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                           | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2014]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 30. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.32 json_search(doc, value) Осуществляет поиск по значению. Возвращает путь к найденному элементу в обратном порядке, NULL если элемент не найден или документ не в формате JSON.
  • 31. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.33 json_search(doc, value) mysql> select json_search(trace, '"trivial_condition_removal"') from  information_schema.optimizer_trace; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | json_search(trace, '"trivial_condition_removal"')                              | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ |transformation:0:steps:condition_processing:0:steps:join_optimization:0:steps:: | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 32. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.34 json_search(doc, value) mysql> select json_search(trace, '"trivial_condition"')  from information_schema.optimizer_trace; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | json_search(trace, '"trivial_condition"') | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | NULL                                      | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.01 sec)
  • 33. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.35 json_search(doc, value) mysql> select json_search('{"Devconf": ["conference", 2014]}',  '"conf%"'); +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | json_search('{"Devconf": ["conference", 2014]}', '"conf%"') | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | 0:Devconf::                                                 | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec) Feature preview! 0.3.2+
  • 34. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.36 json_merge(doc1, doc2, ...) Объединяет два или более документов в один. Возвращает первый документ с присоединёнными последующими. Дубликаты ключей никак не обрабатываются. Внимание! Эта функция не проверяет документы на соответствие формату JSON. Тем не менее открывающие и закрывающие скобки у всех документов должны совпадать. Возвращает NULL если у первого документа нет открывающих- закрывающих скобок или же они не совпадают.
  • 35. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.37 json_safe_merge(doc1, doc2, ...) Объединяет два или более документов в один. Возвращает первый документ с присоединёнными последующими. Дубликаты ключей никак не обрабатываются. Внимание! Эта функция проверяет все документы на соответствие формату JSON. Возвращает NULL если первый документ не в формате JSON.
  • 36. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.38 json_deep_merge(doc1, doc2, ...) Объединяет два или более документов в один. Возвращает первый документ с присоединёнными последующими. Значения дублирующих ключей обновляются. Внимание! Эта функция проверяет все документы на соответствие формату JSON. Возвращает NULL если у первый документ не в формате JSON. Feature preview! 0.3.2+
  • 37. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.39 json_merge(doc1, doc2, ...) mysql> select json_merge('{"Devconf": ["conference", 2013]}',  '{"Devconf": ["conference", 2014]}') as 'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                                                            | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2013], "Devconf": ["conference", 2014]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 38. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.40 json_safe_merge(doc1, doc2, ...) mysql> select json_safe_merge('{"Devconf": ["conference", 2013]}',  '{"Devconf": ["conference", 2014]}') as 'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                                                            | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2013], "Devconf": ["conference", 2014]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 39. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.41 json_deep_merge(doc1, doc2, ...) mysql> select json_deep_merge('{"Devconf": ["conference",  2013]}', '{"Devconf": ["conference", 2014]}') as  'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                                               | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2013, "conference", 2014]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec) Feature preview! 0.3.2+
  • 40. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.42 json_merge(doc1, doc2, ...) mysql> select json_merge('{"Devconf": ["conference", 2013]}',  '{"Devconf": ["conference", 2014]}', '1') as 'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                                                            | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2013], "Devconf": ["conference", 2014]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 41. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.43 json_merge(doc1, doc2, ...) mysql> select json_merge('{"Devconf": ["conference", 2013]}',  '{"Devconf": ["conference" 2014]}') as 'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                                                           | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2013], "Devconf": ["conference" 2014]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 42. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.44 json_safe_merge(doc1, doc2, ...) mysql> select json_safe_merge('{"Devconf":  ["conference", 2013]}',  ­> '{"Devconf": ["conference" 2014]}') as 'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                           | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2013]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 43. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.45 json_deep_merge(doc1, doc2, ...) mysql> select json_deep_merge('{"Devconf":  ["conference", 2013]}',  ­>'{"Devconf": ["conference" 2014]}') as 'Devconf'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Devconf                           | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | {"Devconf": ["conference", 2013]} | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec) Feature preview! 0.3.2+
  • 44. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.46 json_depth(doc) Возвращает количество уровней вложения в документе или NULL если документ не в формате JSON
  • 45. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.47 json_depth(doc) mysql> select json_depth('{"Devconf": ["conference",  2014]}'); +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | json_depth('{"Devconf": ["conference", 2014]}') | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ |                                               3 | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 46. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.48 json_count(doc[, keypart1[, keypart2[, ...]]]) Возвращает количество детей родительского элемента, указанного при помощи пути, корневого элемента если путь опущен или NULL если документ не в формате JSON
  • 47. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.49 json_count(doc, keypart1, keypart2, ...) mysql> select json_count('{"Devconf": ["conference",  2014]}'); +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | json_count('{"Devconf": ["conference", 2014]}') | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ |                                               1 | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 48. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.50 json_count(doc, keypart1, keypart2, ...) mysql> select json_count('{"Devconf": ["conference", 2014]}',  'Devconf'); +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | json_count('{"Devconf": ["conference", 2014]}', 'Devconf') | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ |                                                          2 | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 49. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.51 json_version() Возвращает версию функций.
  • 50. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.52 json_version() mysql> select json_version(); +­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | json_version()             | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | MySQL JSON UDFs 0.3.2­labs | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 51. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.53 json_test_parser(doc) Возвращает текстовое представление parse tree документа JSON, частичное дерево или пустую строку если документ не в формате JSON. Эта функция предназначена исключительно для тестирования и не должна использоваться в рабочем приложении.
  • 52. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.54 json_test_parser(doc) mysql> select json_test_parser('{"Devconf":  ["conference", 2014]}') as 'Parse tree'G ********************** 1. row ********************** Parse tree:  => "conference";              => 2014;          "Devconf" => ["conference", 2014];        => {"Devconf": ["conference", 2014]};
  • 53. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.55 json_test_parser(doc) mysql> select json_test_parser('{"Devconf": ["conference",  2014]') as 'Parse tree'; +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Parse tree                                                   | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ |  => "conference"; => 2014;"Devconf" => ["conference", 2014]; | +­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec)
  • 54. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.56 Insert Picture Here Где взять?
  • 55. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.57 Исходный код и бинарные дистрибутивы MySQL Labs ● Исходный код ● Бинарные дистрибутивы ● x86 and x86_64 ● Generic Linux ● Mac OSX 10.7 ● Windows 7 ● http://labs.mysql.com/
  • 56. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.58 Как инсталлировать? UNIX create function json_valid returns integer soname 'libmy_json_udf.so'; create function json_search returns string soname 'libmy_json_udf.so'; create function json_extract returns string soname 'libmy_json_udf.so'; create function json_replace returns string soname 'libmy_json_udf.so'; create function json_append returns string soname 'libmy_json_udf.so'; ...
  • 57. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.59 Как инсталлировать? Windows create function json_remove returns string  soname 'my_json_udf.dll'; create function json_set returns string  soname 'my_json_udf.dll'; create function json_merge returns string  soname 'my_json_udf.dll'; create function json_contains_key returns integer soname 'my_json_udf.dll'; create function json_test_parser returns string soname 'my_json_udf.dll'; ...
  • 58. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.60 Как инсталлировать или удалить? Готовые скрипты mysql db_name < install_jsonudf.sql  mysql db_name < uninstall_jsonudf.sql Спасибо Daniel van Eeden! 
  • 59. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.61 Зависимости Библиотека Regex Распространяется вместе с дистрибутивом функций UNIX ● Можно использовать системную Windows ● Всегда компилируется статически Вам не нужно устанавливать никаких библиотек, чтобы использовать функции!
  • 60. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.62 Как компилировать? UNIX Вам нужно: ● cmake ● Regex library (поставляется вместе с исходниками) ● Компилятор Как скомпилировать: ● cmake . ­DMYSQL_DIR=/home/sveta/build/mysql­5.6 ● make
  • 61. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.63 Как компилировать? Windows Вам нужно: ● PCRE (поставляется вместе с исходным кодом) ● Visual Studio ● cmake (cmake.org) Чтобы собрать JSON UDF: ● "C:Program Files (x86)CMake 2.8bincmake.exe" ­G  "Visual Studio 11 Win64" . ­DMYSQL_DIR="C:/MySQL/mysql­ 5.6.19" ● devenv my_json_udf.sln /build Release
  • 62. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.64 Больше информации Документация и статьи ● Файл README ● Мой блог: https://blogs.oracle.com/svetasmirnova/ Анонсы ● Мой twitter: https://twitter.com/#!/svetsmirnova
  • 63. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.65 Insert Picture Here Будущее
  • 64. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.66 Зависит от вас Открывайте баги Шлите предложения по улучшению Больше вы пришлёте – больше мы сделаем Сейчас вы можете влиять на решения
  • 65. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.67 Куда посылать баги и feature request-ы MySQL Community bugs database ● https://bugs.mysql.com/ ● Категория ● “MySQL Server: JSON User-defined function (UDF)” Internal Oracle bugs database ● Просите инженеров технической поддержки MySQL открыть баг репорт для вас ● Категория “UDFJSON”
  • 66. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.68 Полезные ссылки https://blogs.oracle.com/svetasmirnova/ https://twitter.com/#!/svetsmirnova http://json.org/ http://www.pcre.org/ http://dev.mysql.com/doc/refman/5.6/en/adding-functions.html http://bugs.mysql.com/ https://support.oracle.com
  • 67. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.69 Insert Picture Here ?
  • 68. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.70 Insert Picture Here СПАСИБО!
  • 69. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.71 The preceding 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.