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 6C1282F4A3 for ; Sat, 17 Nov 2018 08:17:01 -0500 (EST) 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 TctBQup3-FAH for ; Sat, 17 Nov 2018 08:17:01 -0500 (EST) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 CCA612CBA1 for ; Sat, 17 Nov 2018 08:17:00 -0500 (EST) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v1 0/2] box: functional and multikey indexes Date: Sat, 17 Nov 2018 16:16:53 +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: georgy@tarantool.org, Kirill Shcherbatov 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