[tarantool-patches] [PATCH v1 0/2] box: functional and multikey indexes
Kirill Shcherbatov
kshcherbatov at tarantool.org
Sat Nov 17 16:16:53 MSK 2018
http://github.com/tarantool/tarantool/tree/kshch/gh-1260-functional-index
https://github.com/tarantool/tarantool/issues/1260
Tarantool functional and multikey indexes allows you to create
an index based on user-specified function.
Feature use hidden space _i_{index_name}_{space_name} containing
tuples of structure [{extractor_format}{pk_format}] and redefines
on_replace trigger for target space to fill this space. Index
object metamethods are monkeypatched to make indirect lookups in
ispace to retrieve required tuple primary key.
Same tuples indexed by different keys may be returned multiple
(matches key math count) times. To prevent such behavior for
select and count operations builtin filters were implemented.
The :pairs operator can't work such way, so it may return
same tuples.
Kirill Shcherbatov (2):
box: refactor index termination on space drop
box: functional and multikey indexes
src/box/CMakeLists.txt | 1 +
src/box/alter.cc | 61 ++++++-
src/box/index.cc | 9 +
src/box/index.h | 4 +
src/box/index_def.c | 64 +++++++-
src/box/index_def.h | 14 ++
src/box/lua/call.c | 43 +++++
src/box/lua/call.h | 18 ++
src/box/lua/func_idx.lua | 319 ++++++++++++++++++++++++++++++++++++
src/box/lua/schema.lua | 52 ++++--
src/box/lua/space.cc | 21 +++
src/box/memtx_engine.c | 6 +
src/box/vinyl.c | 6 +
src/lua/init.c | 2 +
test/engine/functional_idx.result | 120 ++++++++++++++
test/engine/functional_idx.test.lua | 35 ++++
16 files changed, 753 insertions(+), 22 deletions(-)
create mode 100644 src/box/lua/func_idx.lua
create mode 100644 test/engine/functional_idx.result
create mode 100644 test/engine/functional_idx.test.lua
--
2.7.4
More information about the Tarantool-patches
mailing list