Skip to content
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

Merged
merged 1 commit into from
Oct 25, 2019

Conversation

tiancaiamao
Copy link
Contributor

Benchmark for pingcap/tidb#12872

PTAL @jackysp

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
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tiancaiamao
Copy link
Contributor Author

PTAL @mahjonp

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@mahjonp mahjonp left a 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

@tiancaiamao tiancaiamao merged commit 2ad0bf2 into master Oct 25, 2019
@tiancaiamao tiancaiamao deleted the sysbench-insert-ignore branch October 25, 2019 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants