Skip to content
Snippets Groups Projects
Commit ff09f0c6 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

phia: enable prefix compression in stress test

parent b3cd1b9d
No related merge requests found
......@@ -22,9 +22,13 @@ box.once("phia_stress", function()
local s4 = box.schema.space.create('s4', { engine = 'phia', if_not_exists = true })
s4:create_index('pk', {compression = 'lz4', compression_branch = 'lz4', amqf = 1, if_not_exists = true})
local s5 = box.schema.space.create('s5', { engine = 'phia'})
s5:create_index('pk', {compression_key = 1, amqf = 1})
end)
local spaces = {box.space.s1, box.space.s2, box.space.s3, box.space.s4}
local spaces = {box.space.s1, box.space.s2, box.space.s3, box.space.s4,
box.space.s5}
local function t1(ch, time_limit)
local t1 = fiber.time()
......@@ -33,7 +37,7 @@ local function t1(ch, time_limit)
local t = math.random(80)
local data = string.char(math.random(string.byte('Z') - string.byte('A')) + string.byte('A') - 1)
data = data:rep(math.random(20480))
local space = spaces[math.mod(t, 4) + 1]
local space = spaces[math.mod(t, #spaces) + 1]
if t < 32 then
space:replace({k, data})
elseif t < 40 then
......@@ -54,7 +58,7 @@ local function t2(ch, time_limit)
while fiber.time() - t1 < time_limit do
local k = math.random(10000)
local t = math.random(16)
local space = spaces[math.mod(t, 4) + 1]
local space = spaces[math.mod(t, #spaces) + 1]
if t < 12 then
local l = space:get({k})
else
......@@ -72,7 +76,7 @@ local function t3(ch, time_limit)
local k = math.random(10000)
local t = math.random(20)
local l = math.random(2048)
local space = spaces[math.mod(t, 4) + 1]
local space = spaces[math.mod(t, #spaces) + 1]
if t <= 6 then
space:select(k, { iterator = 'GE', limit = l })
elseif t <= 12 then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment