From: Kirill Shcherbatov <kshcherbatov@tarantool.org> To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com, Kirill Shcherbatov <kshcherbatov@tarantool.org> Subject: [PATCH v4 00/14] box: indexes by JSON path Date: Thu, 11 Oct 2018 10:58:40 +0300 [thread overview] Message-ID: <cover.1539244271.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. This came possible with auxiliary JSON tree structure that contain intermediate path fields and hashtable. 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 (14): box: refactor key_def_find routine box: introduce key_def_parts_are_sequential box: introduce tuple_field_by_relative_path box: introduce tuple_format_add_key_part box: introduce tuple_format_sizeof routine box: move tuple_field_go_to_{index,key} definition box: drop format const qualifier in *init_field_map lib: implement JSON tree class for json library lib: introduce json_path_normalize 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 | 6 +- src/box/key_def.c | 216 ++++++++-- src/box/key_def.h | 52 ++- src/box/lua/index.c | 60 +++ src/box/lua/schema.lua | 22 +- src/box/lua/space.cc | 5 + src/box/memtx_engine.c | 6 +- src/box/memtx_space.c | 5 +- src/box/memtx_space.h | 2 +- src/box/schema.cc | 4 +- src/box/space.c | 4 +- src/box/space.h | 8 +- src/box/sysview.c | 3 +- src/box/tuple.c | 21 +- src/box/tuple_compare.cc | 119 ++++-- src/box/tuple_extract_key.cc | 131 ++++-- src/box/tuple_format.c | 864 +++++++++++++++++++++++++++++++--------- src/box/tuple_format.h | 73 +++- src/box/tuple_hash.cc | 47 ++- src/box/vinyl.c | 9 +- src/box/vy_log.c | 3 +- src/box/vy_lsm.c | 40 +- src/box/vy_point_lookup.c | 2 - src/box/vy_stmt.c | 184 +++++++-- src/lib/json/CMakeLists.txt | 2 + src/lib/json/path.c | 25 ++ src/lib/json/path.h | 18 + src/lib/json/tree.c | 300 ++++++++++++++ src/lib/json/tree.h | 260 ++++++++++++ test/box/misc.result | 57 +-- test/engine/tuple.result | 417 +++++++++++++++++++ test/engine/tuple.test.lua | 120 ++++++ test/unit/json_path.c | 243 ++++++++++- test/unit/json_path.result | 60 ++- test/unit/vy_iterators_helper.c | 6 +- test/unit/vy_mem.c | 2 +- test/unit/vy_point_lookup.c | 2 +- 41 files changed, 2983 insertions(+), 440 deletions(-) create mode 100644 src/lib/json/tree.c create mode 100644 src/lib/json/tree.h -- 2.7.4
next reply other threads:[~2018-10-11 7:58 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-10-11 7:58 Kirill Shcherbatov [this message] 2018-10-11 7:58 ` [PATCH v4 01/14] box: refactor key_def_find routine Kirill Shcherbatov 2018-10-15 17:27 ` Vladimir Davydov 2018-10-11 7:58 ` [PATCH v4 10/14] box: introduce JSON indexes Kirill Shcherbatov 2018-10-16 9:33 ` Vladimir Davydov 2018-10-11 7:58 ` [PATCH v4 11/14] box: introduce has_json_paths flag in templates Kirill Shcherbatov 2018-10-11 7:58 ` [PATCH v4 12/14] box: tune tuple_field_raw_by_path for indexed data Kirill Shcherbatov 2018-10-11 7:58 ` [PATCH v4 13/14] box: introduce offset slot cache in key_part Kirill Shcherbatov 2018-10-11 7:58 ` [PATCH v4 14/14] box: specify indexes in user-friendly form Kirill Shcherbatov 2018-10-11 7:58 ` [PATCH v4 02/14] box: introduce key_def_parts_are_sequential Kirill Shcherbatov 2018-10-15 17:29 ` Vladimir Davydov 2018-10-11 7:58 ` [PATCH v4 03/14] box: introduce tuple_field_by_relative_path Kirill Shcherbatov 2018-10-15 17:46 ` Vladimir Davydov 2018-10-11 7:58 ` [PATCH v4 04/14] box: introduce tuple_format_add_key_part Kirill Shcherbatov 2018-10-15 19:39 ` Vladimir Davydov 2018-10-11 7:58 ` [tarantool-patches] [PATCH v4 05/14] box: introduce tuple_format_sizeof routine Kirill Shcherbatov 2018-10-15 17:52 ` Vladimir Davydov 2018-10-11 7:58 ` [PATCH v4 06/14] box: move tuple_field_go_to_{index,key} definition Kirill Shcherbatov 2018-10-16 8:15 ` Vladimir Davydov 2018-10-11 7:58 ` [PATCH v4 07/14] box: drop format const qualifier in *init_field_map Kirill Shcherbatov 2018-10-11 7:58 ` [PATCH v4 08/14] lib: implement JSON tree class for json library Kirill Shcherbatov 2018-10-16 8:26 ` Vladimir Davydov 2018-10-11 7:58 ` [PATCH v4 09/14] lib: introduce json_path_normalize routine Kirill Shcherbatov 2018-10-16 8:39 ` 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.1539244271.git.kshcherbatov@tarantool.org \ --to=kshcherbatov@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=vdavydov.dev@gmail.com \ --subject='Re: [PATCH v4 00/14] 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