Skip to content
Snippets Groups Projects
Commit ade4860b authored by Igor Kuznetsov's avatar Igor Kuznetsov
Browse files

fix: fix space for local load test

parent d53079cf
No related branches found
No related tags found
1 merge request!1414sbroad import
...@@ -22,7 +22,7 @@ api:eval("function set_schema(s) local cartridge = require('cartridge'); cartrid ...@@ -22,7 +22,7 @@ api:eval("function set_schema(s) local cartridge = require('cartridge'); cartrid
local config = { local config = {
spaces = { spaces = {
VEHICLE_ACTUAL = { vehicle_actual = {
format = { format = {
{ {
name = "id", name = "id",
...@@ -81,7 +81,7 @@ local config = { ...@@ -81,7 +81,7 @@ local config = {
is_local = false, is_local = false,
sharding_key = { "id" }, sharding_key = { "id" },
}, },
VEHICLE_HISTORY = { vehicle_history = {
format = { format = {
{ {
name = "id", name = "id",
...@@ -159,7 +159,7 @@ storage2:eval("return box.space.VEHICLE_HISTORY:truncate();") ...@@ -159,7 +159,7 @@ storage2:eval("return box.space.VEHICLE_HISTORY:truncate();")
for i = 1, record_count, 1 do for i = 1, record_count, 1 do
api:call("insert_record", { api:call("insert_record", {
"VEHICLE_ACTUAL", "vehicle_actual",
{ {
id = i, id = i,
gov_number = "a777a750", gov_number = "a777a750",
...@@ -168,7 +168,7 @@ for i = 1, record_count, 1 do ...@@ -168,7 +168,7 @@ for i = 1, record_count, 1 do
}) })
api:call("insert_record", { api:call("insert_record", {
"VEHICLE_HISTORY", "vehicle_history",
{ {
id = i, id = i,
gov_number = "a777a750", gov_number = "a777a750",
...@@ -184,16 +184,16 @@ fiber.sleep(3) ...@@ -184,16 +184,16 @@ fiber.sleep(3)
print( print(
string.format( string.format(
"Storage 1 has %d actual and %d history records", "Storage 1 has %d actual and %d history records",
storage1:eval("return box.space.VEHICLE_ACTUAL:count();"), storage1:eval("return box.space.vehicle_actual:count();"),
storage1:eval("return box.space.VEHICLE_HISTORY:count();") storage1:eval("return box.space.vehicle_history:count();")
) )
) )
print( print(
string.format( string.format(
"Storage 2 has %d actual and %d history records", "Storage 2 has %d actual and %d history records",
storage2:eval("return box.space.VEHICLE_ACTUAL:count();"), storage2:eval("return box.space.vehicle_actual:count();"),
storage2:eval("return box.space.VEHICLE_HISTORY:count();") storage2:eval("return box.space.vehicle_history:count();")
) )
) )
......
...@@ -10,11 +10,11 @@ let queries = Array.from( ...@@ -10,11 +10,11 @@ let queries = Array.from(
(_, id) => `SELECT * (_, id) => `SELECT *
FROM ( FROM (
SELECT "id", "gov_number" SELECT "id", "gov_number"
FROM VEHICLE_ACTUAL FROM "vehicle_actual"
WHERE "sys_op" = 0 WHERE "sys_op" = 0
UNION ALL UNION ALL
SELECT "id", "gov_number" SELECT "id", "gov_number"
FROM VEHICLE_HISTORY FROM "vehicle_history"
WHERE "sys_op" < 1 WHERE "sys_op" < 1
) as "t1" ) as "t1"
WHERE "id" = ${id}` WHERE "id" = ${id}`
......
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