Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH v2 0/5] box: indexes by JSON path
@ 2018-08-15 12:14 Kirill Shcherbatov
  2018-08-15 12:14 ` [tarantool-patches] [PATCH v2 1/5] rfc: describe a Tarantool JSON indexes Kirill Shcherbatov
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Kirill Shcherbatov @ 2018-08-15 12:14 UTC (permalink / raw)
  To: tarantool-patches; +Cc: v.shpilevoy, Kirill Shcherbatov

Branch: http://github.com/tarantool/tarantool/tree/kshch/gh-1012-json-indexes
Issue: 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 structures per tuple_format:
tree of intermediate path fields and hashtable refers 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).

Changes in v2:
  - new single-malloc memory management for paths in key_parts
    and format.
  - fixed multiple bugs, make vynil engine works:
    1) we need to create tuple with holes via routine
       vy_stmt_new_surrogate_from_key.
    2) as vynil engine has two formats - memory format and disk
       format we enforce offset_slot mapping to be consistent in
       vy_lsm_new to make key_parts slot caches work.
  - optimized tuple_init_field map and other tree-walkers routines.
  - start using format epoch per format.
  - a little more effective memory management for routine
    key_def_normalize_json_path - we try to reuse the biggest free
    chunk if any
  - multiple checks on attempts to create JSON index on space with
    incompatible data, duplicates
  - new tests for JSON paths

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/alter.cc             |   4 +
 src/box/errcode.h            |   2 +-
 src/box/index_def.c          |  10 +-
 src/box/key_def.c            | 281 ++++++++++++++++++---
 src/box/key_def.h            |  27 +-
 src/box/lua/schema.lua       |  58 ++++-
 src/box/lua/space.cc         |   5 +
 src/box/memtx_bitset.c       |   8 +-
 src/box/memtx_engine.c       |   5 +
 src/box/memtx_rtree.c        |   6 +-
 src/box/schema.cc            |  12 +-
 src/box/space.c              |  25 ++
 src/box/space.h              |  10 +
 src/box/tuple.c              |  25 +-
 src/box/tuple_compare.cc     | 123 ++++++++--
 src/box/tuple_extract_key.cc | 161 +++++++++---
 src/box/tuple_format.c       | 573 +++++++++++++++++++++++++++++++++++++++----
 src/box/tuple_format.h       | 103 +++++++-
 src/box/tuple_hash.cc        |  63 ++++-
 src/box/vinyl.c              |   5 +
 src/box/vy_log.c             |   3 +-
 src/box/vy_lsm.c             |  43 ++++
 src/box/vy_point_lookup.c    |   2 -
 src/box/vy_stmt.c            | 124 ++++++++--
 src/box/vy_stmt.h            |   6 +-
 test/box/misc.result         |  51 ++--
 test/engine/iterator.result  |   2 +-
 test/engine/tuple.result     | 307 +++++++++++++++++++++++
 test/engine/tuple.test.lua   |  90 +++++++
 30 files changed, 2103 insertions(+), 219 deletions(-)
 create mode 100644 doc/rfc/1012-json-indexes.md

-- 
2.7.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-09-03 10:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-15 12:14 [tarantool-patches] [PATCH v2 0/5] box: indexes by JSON path Kirill Shcherbatov
2018-08-15 12:14 ` [tarantool-patches] [PATCH v2 1/5] rfc: describe a Tarantool JSON indexes Kirill Shcherbatov
2018-08-15 12:15 ` [tarantool-patches] [PATCH v2 2/5] box: introduce slot_cache in key_part Kirill Shcherbatov
2018-08-22  0:27   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-27  7:37     ` Kirill Shcherbatov
2018-09-03 10:32       ` Vladislav Shpilevoy
2018-08-15 12:15 ` [tarantool-patches] [PATCH v2 3/5] box: introduce path field " Kirill Shcherbatov
2018-08-22  0:26   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-27  7:37     ` Kirill Shcherbatov
2018-08-15 12:15 ` [tarantool-patches] [PATCH v2 4/5] box: introduce path_hash and tuple_field tree Kirill Shcherbatov
2018-08-22  0:26   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-27  7:37     ` Kirill Shcherbatov
2018-08-15 12:15 ` [tarantool-patches] [PATCH v2 5/5] box: specify indexes in user-friendly form Kirill Shcherbatov
2018-08-22  0:26   ` [tarantool-patches] " Vladislav Shpilevoy
2018-08-27  7:37     ` Kirill Shcherbatov
2018-08-22  0:28   ` Vladislav Shpilevoy

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