0

当我使用 tarantool (memtx) 时一切正常,但是当我尝试在 sophia 上运行时 - 它不起作用;(

内存:

logs_space_id           = 'logs'
logs  = box.schema.create_space(logs_space_id)
logs:create_index('primary', {type = 'tree', parts = {1, 'STR', 3, 'STR'}})

为什么索菲亚不起作用?

logs_space_id           = 'logs'
log_space = box.schema.space.create(logs_space_id,
    {
        engine = 'sophia',
        if_not_exists = true
    }
)

log_space:create_index('primary', {
        parts = {1, 'STR', 3, 'STR'}
    }
)
4

1 回答 1

0

Tarantool Sophia引擎的复合索引关键部分必须从头开始,不能稀疏。

例如。

logs:create_index('primary', {type = 'tree', parts = {1, 'STR', 3, 'STR'}})

应该用作

logs:create_index('primary', {type = 'tree', parts = {1, 'STR', 2, 'STR'}})

这是出于性能原因而实施的,将来会修复。

于 2016-03-28T10:09:54.197 回答