Skip to content
Snippets Groups Projects
Commit 3189d4f6 authored by Nick Zavaritsky's avatar Nick Zavaritsky Committed by Konstantin Osipov
Browse files

Fix SELECT vdbe to match tarantool data layout

Data layout in Tarantool is very different from SQLite's.
Consider the following DDL statements:

CREATE TABLE foo (a, b PRIMARY KEY, c)
CREATE INDEX fI  ON foo(a)
INSERT INTO  foo VALUES (
  (1, "one", "junk1")
  (2, "two", "junk2")
)

In SQLite, two BTrees are created:

foo / primary key! other fields / -
 one!1|junk1
 two!2|junk2

fI / index key! primary key / -
 1!one
 2!two

In Tarantool, data is stored with the field order matching
the DDL -
 1|one|junk1
 2|two|junk2

Each index yields data in the same very format.

The following changes were made:

 * fix field number in Column-s at VDBE generation time;
 * fix IdxLE/IdxLT/IdxGE/IdxGT for index keys spanning non-adjacent
   tuple fields in an arbitrary order;
 * tell optimizer that every index can provide every column in order to
   eliminate lookups into the primary index.
parent ed9aa92a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment