Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org, vdavydov.dev@gmail.com
Cc: kostja@tarantool.org, Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [PATCH v3 0/4] box: functional indexes
Date: Wed, 17 Jul 2019 04:20:41 +0300	[thread overview]
Message-ID: <cover.1563326037.git.kshcherbatov@tarantool.org> (raw)

This patchset introduces functional indexes in memtx.
Functional index is an index that use user-defined function to extract
key by processed tuple.

In current implementation only persistent deterministic sandboxed Lua function
previously created with box.schema.func.create may be used in functional index.
This provides a potential ability to support new languages to transparently
extend supported extractors in future (e.g. SQL extractor, C extractor).

Because an _index space is loaded before _func space, functional index initially
created in "disabled state". Then, on loading from a new space _func_index, it
completely rebuilds.

Changes in version 2:
  - new space _func_index
  - new, new enhanced object model for functional indexes infrastructure

Branch: http://github.com/tarantool/tarantool/tree/kshch/gh-1260-functional-index-new
Issue: https://github.com/tarantool/tarantool/issues/1260

Kirill Shcherbatov (4):
  box: introduce key_def->is_multikey flag
  box: refactor key_validate_parts to return key_end
  box: introduce tuple_extra infrastructure
  box: introduce functional indexes in memtx

 src/box/CMakeLists.txt             |   4 +-
 src/box/alter.cc                   | 134 +++++-
 src/box/alter.h                    |   1 +
 src/box/bootstrap.snap             | Bin 5863 -> 5914 bytes
 src/box/box.cc                     |   4 +-
 src/box/call.c                     |   8 +-
 src/box/errcode.h                  |   1 +
 src/box/functional_extractor.c     | 118 +++++
 src/box/functional_extractor.h     | 101 ++++
 src/box/functional_key.c           | 228 ++++++++++
 src/box/functional_key.h           |  94 ++++
 src/box/index.cc                   |  34 +-
 src/box/index.h                    |  38 +-
 src/box/index_def.c                |  11 +-
 src/box/index_def.h                |   9 +-
 src/box/key_def.c                  |  39 +-
 src/box/key_def.h                  |  42 +-
 src/box/lua/key_def.c              |   7 +-
 src/box/lua/misc.cc                |   2 +-
 src/box/lua/schema.lua             |  20 +
 src/box/lua/space.cc               |  15 +
 src/box/lua/upgrade.lua            |  18 +
 src/box/memtx_bitset.c             |   2 +-
 src/box/memtx_engine.c             |  36 +-
 src/box/memtx_rtree.c              |   2 +-
 src/box/memtx_space.c              |  24 +-
 src/box/memtx_tree.c               |  43 +-
 src/box/port.h                     |   4 +-
 src/box/schema.cc                  |  13 +-
 src/box/schema_def.h               |   9 +
 src/box/sql.c                      |   3 +-
 src/box/sql/build.c                |   2 +-
 src/box/sql/select.c               |   3 +-
 src/box/sql/where.c                |   2 +-
 src/box/tuple.c                    |  35 +-
 src/box/tuple.h                    | 103 ++++-
 src/box/tuple_bloom.c              |   4 +-
 src/box/tuple_compare.cc           | 228 +++++++---
 src/box/tuple_extract_key.cc       |  21 +-
 src/box/tuple_format.c             |  58 ++-
 src/box/tuple_format.h             |  32 ++
 src/box/tuple_hash.cc              |   7 +-
 src/box/vinyl.c                    |  20 +-
 src/box/vy_stmt.c                  |   2 +
 src/box/vy_stmt.h                  |   6 +-
 test/app-tap/tarantoolctl.test.lua |   4 +-
 test/box-py/bootstrap.result       |   5 +
 test/box/access.result             |   3 +
 test/box/access.test.lua           |   1 +
 test/box/access_misc.result        | 132 +++---
 test/box/access_sysview.result     |   6 +-
 test/box/alter.result              |   7 +-
 test/box/bitset.result             |  24 +
 test/box/bitset.test.lua           |   9 +
 test/box/hash.result               |  24 +
 test/box/hash.test.lua             |   9 +
 test/box/misc.result               |   1 +
 test/box/rtree_misc.result         |  24 +
 test/box/rtree_misc.test.lua       |   9 +
 test/engine/engine.cfg             |   5 +-
 test/engine/functional.result      | 708 +++++++++++++++++++++++++++++
 test/engine/functional.test.lua    | 240 ++++++++++
 test/unit/luaT_tuple_new.c         |   2 +-
 test/unit/merger.test.c            |   8 +-
 test/unit/tuple_bigref.c           |   2 +-
 test/unit/vy_iterators_helper.c    |   2 +-
 test/vinyl/misc.result             |  23 +
 test/vinyl/misc.test.lua           |   9 +
 test/wal_off/alter.result          |   2 +-
 69 files changed, 2619 insertions(+), 227 deletions(-)
 create mode 100644 src/box/functional_extractor.c
 create mode 100644 src/box/functional_extractor.h
 create mode 100644 src/box/functional_key.c
 create mode 100644 src/box/functional_key.h
 create mode 100644 test/engine/functional.result
 create mode 100644 test/engine/functional.test.lua

-- 
2.22.0

             reply	other threads:[~2019-07-17  1:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17  1:20 Kirill Shcherbatov [this message]
2019-07-17  1:20 ` [PATCH v3 1/4] box: introduce key_def->is_multikey flag Kirill Shcherbatov
2019-07-17 14:34   ` Konstantin Osipov
2019-07-18 11:20   ` [tarantool-patches] " Kirill Yukhin
2019-07-17  1:20 ` [PATCH v3 2/4] box: refactor key_validate_parts to return key_end Kirill Shcherbatov
2019-07-18  9:41   ` Konstantin Osipov
2019-07-18 11:21   ` [tarantool-patches] " Kirill Yukhin
2019-07-17  1:20 ` [PATCH v3 3/4] box: introduce tuple_extra infrastructure Kirill Shcherbatov
2019-07-18  9:47   ` Konstantin Osipov
2019-07-17  1:20 ` [PATCH v3 4/4] box: introduce functional indexes in memtx Kirill Shcherbatov
2019-07-18  9:50   ` [tarantool-patches] " Konstantin Osipov
2019-07-18  9:54   ` Konstantin Osipov
2019-07-18  9:55   ` Konstantin Osipov
2019-07-18 10:02   ` Konstantin Osipov
2019-07-22 14:45   ` 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.1563326037.git.kshcherbatov@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH v3 0/4] box: functional indexes' \
    /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