Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH v4 0/4] box: functional indexes
@ 2019-07-24  7:36 Kirill Shcherbatov
  2019-07-24  7:36 ` [PATCH v4 1/4] box: introduce tuple_chunk infrastructure Kirill Shcherbatov
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Kirill Shcherbatov @ 2019-07-24  7:36 UTC (permalink / raw)
  To: tarantool-patches, kostja; +Cc: vdavydov.dev, Kirill Shcherbatov

This patchset introduces functional indexes in memtx.
Functional index is an index that use user-defined function to extract
a key by 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.

Comment:
  - I'll send a follow-up patch to specify function by name a bit later.

Changes in version 4:
  - functional indexes are implemented with memtx_tree vtab like
    version 1 did
  - index object doesn't use hash at all

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

Kirill Shcherbatov (4):
  box: introduce tuple_chunk infrastructure
  box: generalize memtx_multikey_tree methods
  box: refactor memtx_tree_delete_identical
  box: introduce functional indexes

 src/box/alter.h                    |   1 +
 src/box/errcode.h                  |   1 +
 src/box/func_key.h                 | 117 +++++
 src/box/index.h                    |   9 +
 src/box/index_def.h                |  16 +
 src/box/key_def.h                  |  22 +-
 src/box/schema_def.h               |   9 +
 src/box/tuple.h                    |  28 ++
 src/box/tuple_format.h             |   9 +
 src/lib/salad/bps_tree.h           |   9 +-
 src/box/func_key.c                 | 135 ++++++
 src/box/index_def.c                |  21 +-
 src/box/key_def.c                  |  32 +-
 src/box/lua/key_def.c              |   2 +-
 src/box/memtx_engine.c             |  29 ++
 src/box/memtx_space.c              |  18 +
 src/box/memtx_tree.c               | 334 +++++++++++++-
 src/box/sql.c                      |   2 +-
 src/box/sql/build.c                |   2 +-
 src/box/sql/select.c               |   2 +-
 src/box/sql/where.c                |   2 +-
 src/box/tuple.c                    |   8 +
 src/box/vinyl.c                    |   9 +-
 src/box/vy_stmt.c                  |   2 +
 test/unit/luaT_tuple_new.c         |   2 +-
 test/unit/merger.test.c            |   4 +-
 src/box/CMakeLists.txt             |   1 +
 src/box/alter.cc                   | 107 ++++-
 src/box/bootstrap.snap             | Bin 5863 -> 5914 bytes
 src/box/index.cc                   |  28 ++
 src/box/lua/schema.lua             |  20 +
 src/box/lua/space.cc               |   7 +
 src/box/lua/upgrade.lua            |  18 +
 src/box/schema.cc                  |  12 +-
 src/box/tuple_compare.cc           | 104 ++++-
 src/box/tuple_extract_key.cc       |  29 +-
 src/box/tuple_hash.cc              |   1 +
 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      | 690 +++++++++++++++++++++++++++++
 test/engine/functional.test.lua    | 233 ++++++++++
 test/unit/bps_tree.cc              |   8 +-
 test/unit/bps_tree.result          |   4 +-
 test/vinyl/misc.result             |  23 +
 test/vinyl/misc.test.lua           |   9 +
 test/wal_off/alter.result          |   2 +-
 59 files changed, 2251 insertions(+), 133 deletions(-)
 create mode 100644 src/box/func_key.h
 create mode 100644 src/box/func_key.c
 create mode 100644 test/engine/functional.result
 create mode 100644 test/engine/functional.test.lua

-- 
2.22.0

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

end of thread, other threads:[~2019-07-25 11:22 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24  7:36 [PATCH v4 0/4] box: functional indexes Kirill Shcherbatov
2019-07-24  7:36 ` [PATCH v4 1/4] box: introduce tuple_chunk infrastructure Kirill Shcherbatov
2019-07-24  7:36 ` [PATCH v4 2/4] box: generalize memtx_multikey_tree methods Kirill Shcherbatov
2019-07-24 19:24   ` Konstantin Osipov
2019-07-24  7:36 ` [PATCH v4 3/4] box: refactor memtx_tree_delete_identical Kirill Shcherbatov
2019-07-24 19:24   ` Konstantin Osipov
2019-07-24  7:36 ` [PATCH v4 4/4] box: introduce functional indexes Kirill Shcherbatov
2019-07-24 12:24   ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 19:41   ` Konstantin Osipov
2019-07-24 20:04   ` Konstantin Osipov
2019-07-24 20:22   ` Konstantin Osipov
2019-07-25 11:20     ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 20:44   ` Konstantin Osipov
2019-07-25 11:22     ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 21:07   ` Konstantin Osipov
2019-07-25  8:27     ` [tarantool-patches] " Kirill Shcherbatov
2019-07-25  8:40       ` Konstantin Osipov
2019-07-25 11:18         ` Kirill Shcherbatov
2019-07-24 21:17   ` Konstantin Osipov
2019-07-24 21:56   ` Konstantin Osipov
2019-07-25  8:33     ` [tarantool-patches] " Kirill Shcherbatov
2019-07-24 12:25 ` [tarantool-patches] [PATCH v4 4/5] box: fix memtx_tree_index_build_array_deduplicate Kirill Shcherbatov

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