GS
:pairs('a',{iterator='GE'}):take_while(function(t) return t[1]:match('^a') end):totable();)
Size: a a a
GS
:pairs('a',{iterator='GE'}):take_while(function(t) return t[1]:match('^a') end):totable()GS
F
F
OK
F
OK
-- Space
space_format = {
{ name = 'id', type = 'string' }
{ name = 'property', type = 'string' }
{ name = 'meta', type = '*' }
}
-- indexes
primary = { parts = { 'id' }, unique = true }
property = { parts = { 'property' }, unique = false }
-- scan
box.space.goods.index.property:select({ 'some_property' }, { limit = 10 })
OK
F
F
OK
F
OK
-- Space
space_format = {
{ name = 'id', type = 'string' }
{ name = 'property', type = 'string' }
{ name = 'meta', type = '*' }
}
-- indexes
primary = { parts = { 'id' }, unique = true }
property = { parts = { 'property', 'id' }, unique = true }
-- scan
prop = 'some_property'
if last_id == nil then
return box.space.goods.index.property:select({ prop }, { limit = 10 })
else
return box.space.goods.index.property:pairs({ prop, last_id }, { iterator = 'GT' })
:take_while(function(t)
return t.property == prop
end)
:take(10)
:totable()
end
OK
OK
OK
F
OK
ОБ
OK
unix/:./data/breeze_01.control> local offset = 0 local start = require 'clock'.time() box.space.t.index.prop:select({0}, { limit = 10, offset = offset }) return require 'clock'.time() - start
---
- 0.00054216384887695
...
unix/:./data/breeze_01.control> local offset = 999990 local start = require 'clock'.time() box.space.t.index.prop:select({0}, { limit = 10, offset = offset }) return require 'clock'.time() - start
---
- 0.15941262245178
...