Skip to content

Commit

Permalink
Add performance tests to compare crud and vshard
Browse files Browse the repository at this point in the history
This patch reworks existing performance tests and adds new cases:
select for equal conditions for primary and secondary indexes
(including #220 case). It also adds corresponding vshard test cases
to compare performance. Comparison may be not exactly precise since
vshard test functions use naive mergers, but should at least estimate
basic differences.

Closes #225
  • Loading branch information
DifferentialOrange committed Dec 20, 2021
1 parent 3332a01 commit 21420dd
Show file tree
Hide file tree
Showing 2 changed files with 419 additions and 33 deletions.
11 changes: 9 additions & 2 deletions test/entrypoint/srv_ddl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ package.preload['customers-storage'] = function()
},
}

local customers_id_schema = table.deepcopy(customers_schema)
customers_id_schema.sharding_key = {'id'}
table.insert(customers_id_schema.indexes, primary_index_id)
table.insert(customers_id_schema.indexes, bucket_id_index)
table.insert(customers_id_schema.indexes, age_index)

local customers_name_key_schema = table.deepcopy(customers_schema)
customers_name_key_schema.sharding_key = {'name'}
table.insert(customers_name_key_schema.indexes, primary_index)
Expand Down Expand Up @@ -133,6 +139,7 @@ package.preload['customers-storage'] = function()

local schema = {
spaces = {
customers = customers_id_schema,
customers_name_key = customers_name_key_schema,
customers_name_key_uniq_index = customers_name_key_uniq_index_schema,
customers_name_key_non_uniq_index = customers_name_key_non_uniq_index_schema,
Expand Down Expand Up @@ -166,8 +173,8 @@ local ok, err = errors.pcall('CartridgeCfgError', cartridge.cfg, {
'customers-storage',
'cartridge.roles.crud-router',
'cartridge.roles.crud-storage',
},
})
}}, { readahead = 20 * 1024 * 1024 }
)

if not ok then
log.error('%s', err)
Expand Down
Loading

0 comments on commit 21420dd

Please sign in to comment.