From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 225B2280B2 for ; Mon, 6 Aug 2018 08:27:08 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S_u1ZsOi9bx8 for ; Mon, 6 Aug 2018 08:27:07 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 59EDA27D4A for ; Mon, 6 Aug 2018 08:27:07 -0400 (EDT) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v1 0/5] box: indexes by JSON path Date: Mon, 6 Aug 2018 15:26:57 +0300 Message-Id: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Kirill Shcherbatov 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 structures per tuple_format: tree of intermediate path fields and hashtable referes to leaf field that use path as key. 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. RFC contains detailed description of those concepts. Finally, supported ability to define JSON paths in user-friendly form containing format field name(that could be changed). Branch: http://github.com/tarantool/tarantool/tree/kshch/gh-1012-json-indexes Issue: https://github.com/tarantool/tarantool/issues/1012 Kirill Shcherbatov (5): rfc: describe a Tarantool JSON indexes box: introduce slot_cache in key_part box: introduce path field in key_part box: introduce path_hash and tuple_field tree box: specify indexes in user-friendly form doc/rfc/1012-json-indexes.md | 188 ++++++++++++++ src/box/errcode.h | 2 +- src/box/index_def.c | 8 +- src/box/key_def.c | 199 ++++++++++++++- src/box/key_def.h | 17 +- src/box/lua/schema.lua | 58 ++++- src/box/lua/space.cc | 5 + src/box/memtx_bitset.c | 4 +- src/box/memtx_rtree.c | 2 +- src/box/schema.cc | 8 +- src/box/tuple_bloom.c | 8 +- src/box/tuple_compare.cc | 48 ++-- src/box/tuple_extract_key.cc | 36 ++- src/box/tuple_format.c | 570 +++++++++++++++++++++++++++++++++++++++++-- src/box/tuple_format.h | 35 ++- src/box/tuple_hash.cc | 28 +-- src/box/tuple_hash.h | 5 +- src/box/vy_log.c | 3 +- src/box/vy_stmt.h | 2 +- test/box/misc.result | 51 ++-- test/engine/iterator.result | 2 +- test/engine/tuple.result | 137 +++++++++++ test/engine/tuple.test.lua | 37 +++ 23 files changed, 1300 insertions(+), 153 deletions(-) create mode 100644 doc/rfc/1012-json-indexes.md -- 2.7.4