Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org, vdavydov.dev@gmail.com
Cc: kostja@tarantool.org, Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [PATCH v5 0/9] box: indexes by JSON path
Date: Mon, 26 Nov 2018 13:49:34 +0300	[thread overview]
Message-ID: <cover.1543229303.git.kshcherbatov@tarantool.org> (raw)

http://github.com/tarantool/tarantool/tree/kshch/gh-1012-json-indexes
https://github.com/tarantool/tarantool/issues/1012

Sometimes field data could have complex document structure.
When this structure is consistent across whole document,
you are able to create an index by JSON path.
New JSON tree class is used to manage tuple_field(s) defined for
format. This allows to work with fields in unified way.
To speed-up data access by JSON index key_part structure extended
with offset_slot cache that points to field_map item containing
data offset for current tuple. Initialization of the field map is
done by traversing the tree to detect vertices that are missing
in the msgpack.
Introduced offset_slot_cache in key_part to tune data access
for typical scenario of using tuples that have same format.

Kirill Shcherbatov (9):
  box: refactor json_path_parser class
  lib: implement JSON tree class for json library
  box: manage format fields with JSON tree class
  lib: introduce json_path_cmp routine
  box: introduce JSON indexes
  box: introduce has_json_paths flag in templates
  box: tune tuple_field_raw_by_path for indexed data
  box: introduce offset slot cache in key_part
  box: specify indexes in user-friendly form

 src/box/alter.cc                |   7 +-
 src/box/blackhole.c             |   5 +-
 src/box/engine.h                |  11 +-
 src/box/errcode.h               |   2 +-
 src/box/index_def.c             |   8 +-
 src/box/key_def.c               | 171 +++++++++--
 src/box/key_def.h               |  31 +-
 src/box/lua/index.c             |  66 +++++
 src/box/lua/schema.lua          |  22 +-
 src/box/lua/space.cc            |   5 +
 src/box/lua/tuple.c             |   2 +-
 src/box/memtx_engine.c          |   7 +-
 src/box/memtx_space.c           |   5 +-
 src/box/memtx_space.h           |   2 +-
 src/box/schema.cc               |   4 +-
 src/box/space.c                 |   6 +-
 src/box/space.h                 |   8 +-
 src/box/sql.c                   |  17 +-
 src/box/sql/build.c             |   6 +-
 src/box/sql/select.c            |   6 +-
 src/box/sql/where.c             |   1 +
 src/box/sysview.c               |   3 +-
 src/box/tuple.c                 |  40 +--
 src/box/tuple_compare.cc        | 125 +++++---
 src/box/tuple_extract_key.cc    | 121 +++++---
 src/box/tuple_format.c          | 633 ++++++++++++++++++++++++++++++++--------
 src/box/tuple_format.h          |  80 ++++-
 src/box/tuple_hash.cc           |  47 ++-
 src/box/vinyl.c                 |  10 +-
 src/box/vy_log.c                |   3 +-
 src/box/vy_lsm.c                |   5 +-
 src/box/vy_point_lookup.c       |   2 -
 src/box/vy_stmt.c               | 168 +++++++++--
 src/lib/json/CMakeLists.txt     |   3 +-
 src/lib/json/json.c             | 537 ++++++++++++++++++++++++++++++++++
 src/lib/json/json.h             | 296 +++++++++++++++++++
 src/lib/json/path.c             | 244 ----------------
 src/lib/json/path.h             | 112 -------
 test/box/misc.result            |   1 +
 test/engine/tuple.result        | 462 +++++++++++++++++++++++++++++
 test/engine/tuple.test.lua      | 135 +++++++++
 test/unit/json_path.c           | 281 ++++++++++++++++--
 test/unit/json_path.result      |  51 +++-
 test/unit/vy_iterators_helper.c |   6 +-
 test/unit/vy_mem.c              |   2 +-
 test/unit/vy_point_lookup.c     |   2 +-
 46 files changed, 3006 insertions(+), 755 deletions(-)
 create mode 100644 src/lib/json/json.c
 create mode 100644 src/lib/json/json.h
 delete mode 100644 src/lib/json/path.c
 delete mode 100644 src/lib/json/path.h

-- 
2.7.4

             reply	other threads:[~2018-11-26 10:49 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 10:49 Kirill Shcherbatov [this message]
2018-11-26 10:49 ` [PATCH v5 1/9] box: refactor json_path_parser class Kirill Shcherbatov
2018-11-26 12:53   ` [tarantool-patches] " Kirill Shcherbatov
2018-11-29 15:39     ` Vladimir Davydov
2018-11-26 10:49 ` [PATCH v5 2/9] lib: implement JSON tree class for json library Kirill Shcherbatov
2018-11-26 12:53   ` [tarantool-patches] " Kirill Shcherbatov
2018-11-29 17:38     ` Vladimir Davydov
2018-11-29 17:50       ` Vladimir Davydov
2018-12-04 15:22       ` Vladimir Davydov
2018-12-04 15:47       ` [tarantool-patches] " Kirill Shcherbatov
2018-12-04 17:54         ` Vladimir Davydov
2018-12-05  8:37           ` Kirill Shcherbatov
2018-12-05  9:07             ` Vladimir Davydov
2018-12-05  9:52               ` Vladimir Davydov
2018-12-06  7:56                 ` Kirill Shcherbatov
2018-12-06  7:56                 ` [tarantool-patches] Re: [PATCH v5 2/9] lib: make index_base support for json_lexer Kirill Shcherbatov
2018-11-26 10:49 ` [PATCH v5 3/9] box: manage format fields with JSON tree class Kirill Shcherbatov
2018-11-29 19:07   ` Vladimir Davydov
2018-12-04 15:47     ` [tarantool-patches] " Kirill Shcherbatov
2018-12-04 16:09       ` Vladimir Davydov
2018-12-04 16:32         ` Kirill Shcherbatov
2018-12-05  8:37         ` Kirill Shcherbatov
2018-12-06  7:56         ` Kirill Shcherbatov
2018-12-06  8:06           ` Vladimir Davydov
2018-11-26 10:49 ` [PATCH v5 4/9] lib: introduce json_path_cmp routine Kirill Shcherbatov
2018-11-30 10:46   ` Vladimir Davydov
2018-12-03 17:37     ` [tarantool-patches] " Konstantin Osipov
2018-12-03 18:48       ` Vladimir Davydov
2018-12-03 20:14         ` Konstantin Osipov
2018-12-06  7:56           ` [tarantool-patches] Re: [PATCH v5 4/9] lib: introduce json_path_cmp, json_path_validate Kirill Shcherbatov
2018-11-26 10:49 ` [tarantool-patches] [PATCH v5 5/9] box: introduce JSON indexes Kirill Shcherbatov
2018-11-30 21:28   ` Vladimir Davydov
2018-12-01 16:49     ` Vladimir Davydov
2018-11-26 10:49 ` [PATCH v5 6/9] box: introduce has_json_paths flag in templates Kirill Shcherbatov
2018-11-26 10:49 ` [PATCH v5 7/9] box: tune tuple_field_raw_by_path for indexed data Kirill Shcherbatov
2018-12-01 17:20   ` Vladimir Davydov
2018-11-26 10:49 ` [PATCH v5 8/9] box: introduce offset slot cache in key_part Kirill Shcherbatov
2018-12-03 21:04   ` Vladimir Davydov
2018-12-04 15:51     ` Vladimir Davydov
2018-11-26 10:49 ` [PATCH v5 9/9] box: specify indexes in user-friendly form Kirill Shcherbatov
2018-12-04 12:22   ` Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1543229303.git.kshcherbatov@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH v5 0/9] box: indexes by JSON path' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox