For sharding on tarantool I'am using rocks https://github.com/tarantool/shard and it works perfect for searching by primary
index.
I have space events
with primary
key and secondary
index.
box.schema.create_space('events')
box.space.events:create_index(
"id", {type = 'primary', parts = {1, 'unsigned'}}
)
box.space.events:create_index(
"secondary", {type = "tree", unique=true, parts = {2, 'str'}}
)
shard.events:insert{1, "pv.1", 3, 12345671, "uuid1"}
shard.events:insert{2, "pv.2", 3, 12345672, "uuid2"}
-- query by primary index works! and return tuple
shard.events:select{2}
-- query by secondary index NOT work!
shard.events.index.event_hash:select('pv.2', {iterator = box.index.EQ})
My question is:
What I have to use or what i have to do for query shards by secondary
index?