From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH v9 3/6] box: introduce JSON Indexes
Date: Mon, 4 Feb 2019 15:26:05 +0300 [thread overview]
Message-ID: <20190204122605.hqzoe7hszfssu6cd@esperanza> (raw)
In-Reply-To: <899474d430fb62a79a0af1c83b5ad6262aec2923.1549187339.git.kshcherbatov@tarantool.org>
On Sun, Feb 03, 2019 at 01:20:23PM +0300, Kirill Shcherbatov wrote:
> New JSON indexes allows to index documents content.
> At first, introduced new key_part fields path and path_len
> representing JSON path string specified by user. Modified
> tuple_format_use_key_part routine constructs corresponding
> tuple_fields chain in tuple_format::fields tree to indexed data.
> The resulting tree is used for type checking and for alloctating
> indexed fields offset slots.
>
> Then refined tuple_init_field_map routine logic parses tuple
> msgpack in depth using stack allocated on region and initialize
> field map with corresponding tuple_format::field if any.
> Finally, to proceed memory allocation for vinyl's secondary key
> restored by extracted keys loaded from disc without fields
> tree traversal, introduced format::min_tuple_size field - the
> size of tuple_format tuple as if all leaf fields are zero.
>
> Example:
> To create a new JSON index specify path to document data as a
> part of key_part:
> parts = {{3, 'str', path = '.FIO.fname', is_nullable = false}}
> idx = s:create_index('json_idx', {parts = parse})
> idx:select("Ivanov")
>
> Part of #1012
> ---
> src/box/alter.cc | 2 +-
> src/box/index_def.c | 10 +-
> src/box/key_def.c | 157 ++++++++--
> src/box/key_def.h | 34 +-
> src/box/lua/space.cc | 5 +
> src/box/memtx_engine.c | 4 +
> src/box/sql.c | 1 +
> src/box/sql/build.c | 1 +
> src/box/sql/select.c | 3 +-
> src/box/sql/where.c | 1 +
> src/box/tuple_compare.cc | 7 +-
> src/box/tuple_extract_key.cc | 35 ++-
> src/box/tuple_format.c | 374 ++++++++++++++++++----
> src/box/tuple_format.h | 60 +++-
> src/box/tuple_hash.cc | 2 +-
> src/box/vinyl.c | 4 +
> src/box/vy_log.c | 61 +++-
> src/box/vy_point_lookup.c | 4 +-
> src/box/vy_stmt.c | 202 +++++++++---
> test/engine/json.result | 591 +++++++++++++++++++++++++++++++++++
> test/engine/json.test.lua | 167 ++++++++++
> 21 files changed, 1546 insertions(+), 179 deletions(-)
> create mode 100644 test/engine/json.result
> create mode 100644 test/engine/json.test.lua
Pushed to 2.1.
next prev parent reply other threads:[~2019-02-04 12:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-03 10:20 [PATCH v9 0/6] box: Indexes by JSON path Kirill Shcherbatov
2019-02-03 10:20 ` [PATCH v9 1/6] lib: update msgpuck library Kirill Shcherbatov
2019-02-04 9:48 ` Vladimir Davydov
2019-02-03 10:20 ` [PATCH v9 2/6] box: introduce tuple_field_raw_by_path routine Kirill Shcherbatov
2019-02-04 10:37 ` Vladimir Davydov
2019-02-03 10:20 ` [PATCH v9 3/6] box: introduce JSON Indexes Kirill Shcherbatov
2019-02-04 12:26 ` Vladimir Davydov [this message]
2019-02-03 10:20 ` [PATCH v9 4/6] box: introduce has_json_paths flag in templates Kirill Shcherbatov
2019-02-04 12:31 ` Vladimir Davydov
2019-02-03 10:20 ` [PATCH v9 5/6] box: introduce offset_slot cache in key_part Kirill Shcherbatov
2019-02-04 12:56 ` Vladimir Davydov
2019-02-04 13:02 ` [tarantool-patches] " Kirill Shcherbatov
2019-02-04 15:10 ` Vladimir Davydov
2019-02-03 10:20 ` [PATCH v9 6/6] box: specify indexes in user-friendly form Kirill Shcherbatov
2019-02-04 15:30 ` 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=20190204122605.hqzoe7hszfssu6cd@esperanza \
--to=vdavydov.dev@gmail.com \
--cc=kshcherbatov@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='Re: [PATCH v9 3/6] box: introduce JSON Indexes' \
/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