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.
Showing
- src/box/sql.c 70 additions, 0 deletionssrc/box/sql.c
- src/box/sql/build.c 7 additions, 0 deletionssrc/box/sql/build.c
- src/box/sql/tarantoolInt.h 7 additions, 0 deletionssrc/box/sql/tarantoolInt.h
- src/box/sql/vdbeInt.h 5 additions, 0 deletionssrc/box/sql/vdbeInt.h
- src/box/sql/vdbeaux.c 134 additions, 117 deletionssrc/box/sql/vdbeaux.c
- src/box/sql/where.c 3 additions, 0 deletionssrc/box/sql/where.c
- test/box/sql-transition.result 76 additions, 0 deletionstest/box/sql-transition.result
- test/box/sql-transition.test.lua 28 additions, 1 deletiontest/box/sql-transition.test.lua
Loading
Please register or sign in to comment