Skip to content

sql: Removing sqlite btree from tarantool

Alexey Khatskevich edited this page Sep 7, 2017 · 1 revision

Problem

We store main data in the tarantool engine (memtx), but there are also ephemeral tables, which are used to perform intermediate calculations (such as sort, distinct, join...). These calculations are performed using sqlite native btree structure. There are several reasons why do we want to get rid of sqlite native btree:

  1. Maintain two code bases (tarantool trees and sqlite trees)
  2. Maintain two api bases (there are many engine-specific crutches in sqlite) ...

Solutions

Replace btree index with a special temporary engine

The idea is that we implement new temp engine which does not persist and does not support transactions. Implementation is the following: creative copy-paste from memtx.

Advantages of this particular solution

  1. It gives the ability to create secondary indexes in tables of that kind.
  2. It will allow us to use space api for both: temp tables and ordinary tables.
  3. We can reuse this space for other cases.?

Disadvantages of this particular solution

  1. It will not use disc cache for temp tables in comparison to sqlite's btree.
  2. It is relatively hard to implement (we will have to create and maintain a new space).

Use just btree structures from tarantool?

Disadvantages of this particular solution

  1. We have to implement secondary indexes on our own
  2. We will have to perform requests in temp and ordinary tables in different ways
Clone this wiki locally