[PATCH 0/7] Support multikey indexes in Vinyl

Vladimir Davydov vdavydov.dev at gmail.com
Wed May 8 20:22:32 MSK 2019


A pretty straightforward patch set that implements multikey index
support for Vinyl spaces. The idea is to use vy_entry.hint to store
multikey array entry offsets instead of comparison hints, similarly
to how it is done in memtx. As we have already patched Vinyl to store
statements in vy_entry containers, this patch set is fairly small.

The series is organized as follows.

Patch 1 makes tuple comparison hints mandatory. This allows to remove
quite a bit of code. It shouldn't hurt performance as we use hinted
versions pretty much everywhere these days. This change was approved by
Kostja a while back.

Patches 2-4 add multikey_idx argument to generic functions needed by
Vinyl (key extractor, tuple bloom, field lookup) so that they can be
used with multikey indexes.

Patch 5 teaches Vinyl statement constructors to use tuple_bloom_builder.
This is necessary to support field map extents, which are integral to
multikey indexes.

Patch 6 makes the run writer use entry hints to extract and hash key
parts when dumping statements to disk so that once hints are used to
store multikey offsets it will dump multikey tuples correctly.

Patch 7 completes the series by patching those places in the code where
we insert tuples so that now they iterate over multikey entries and
insert the statement for each multikey occurrence.

https://github.com/tarantool/tarantool/commits/dv/vy-multikey-index

Vladimir Davydov (7):
  Make tuple comparison hints mandatory
  Get rid of tuple_field_by_part_multikey
  Make tuple_extract_key support multikey indexes
  Make tuple_bloom support multikey indexes
  vinyl: use field_map_builder for constructing stmt field map
  vinyl: use multikey hints while writing runs
  vinyl: implement multikey index support

 src/box/index.cc              |   2 +-
 src/box/key_def.c             |   5 +-
 src/box/key_def.h             | 120 +++++-------------
 src/box/lua/key_def.c         |   7 +-
 src/box/memtx_bitset.c        |   6 +-
 src/box/memtx_hash.c          |   7 +-
 src/box/memtx_rtree.c         |   3 +-
 src/box/memtx_space.c         |   6 +-
 src/box/memtx_tree.c          |  41 +++---
 src/box/request.c             |   5 +-
 src/box/space.c               |   5 +-
 src/box/sql.c                 |  10 +-
 src/box/sql/analyze.c         |   5 +-
 src/box/tuple.h               |  29 ++---
 src/box/tuple_bloom.c         |  16 ++-
 src/box/tuple_bloom.h         |   9 +-
 src/box/tuple_compare.cc      | 284 +++++++++++-------------------------------
 src/box/tuple_extract_key.cc  |  58 ++++++---
 src/box/tuple_hash.cc         |  19 +--
 src/box/vinyl.c               | 152 ++++++++++++----------
 src/box/vy_range.c            |   3 +-
 src/box/vy_run.c              |  36 +++---
 src/box/vy_stmt.c             |  96 +++++++-------
 src/box/vy_stmt.h             | 136 ++++++++++----------
 src/box/vy_tx.c               |  43 +++++--
 src/box/vy_tx.h               |  19 +--
 src/box/vy_upsert.c           |   3 +-
 test/box/bitset.result        |  15 +++
 test/box/bitset.test.lua      |   6 +
 test/box/hash.result          |  15 +++
 test/box/hash.test.lua        |   6 +
 test/box/rtree_misc.result    |  15 +++
 test/box/rtree_misc.test.lua  |   6 +
 test/engine/engine.cfg        |   3 -
 test/engine/multikey.result   |  40 +-----
 test/engine/multikey.test.lua |  16 +--
 36 files changed, 573 insertions(+), 674 deletions(-)

-- 
2.11.0




More information about the Tarantool-patches mailing list