-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sysbench: add a 'insert ignore' bench test with unique indices #52
Conversation
function event() | ||
local table_name = "sbtest" .. sysbench.rand.uniform(1, sysbench.opt.tables) | ||
local query = string.format("INSERT IGNORE INTO %s (id, k, c, pad) VALUES ", table_name) | ||
for i = 1, 5 do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use a larger number, I think 5 is a bit small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a prepared statement, if we use a lot of VALUES, the performance would be affected by the parser (the dominant time cost) and then the test can't reflect the truth.
5 is enough to cover insert ignore code and prevent the performance regression if a request visit TiKV multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is OK. Below 100 values, the effects of parser should be negligible. Also, you could also use the prepare statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you could also use the prepare statement.
emmmm... I'd like to but I'm not so familiar with Lua this bench framework... so just get things done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a parameter: Eg, https://github.com/pingcap/productivity-tools/blob/master/benchmark/batch_insert/batch_insert.lua#L65
PTAL @mahjonp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reproduced the performance improvement successfully. LGTM
Benchmark for pingcap/tidb#12872
PTAL @jackysp