How many statements are there in one TPS during sysbench testing?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: sysbench 测试的时候,1个tps里面有多少条语句

| username: Raymond

May I ask, during sysbench testing, how many statements are there in 1 tps? Where can I see this in the lua code?

| username: 啦啦啦啦啦 | Original post link

Each type is different. For example, a point query has one TPS, and you can roughly figure it out by dividing QPS by TPS.

| username: forever | Original post link

The specific Lua script you are running has corresponding functions that will call specific functions in common. This is related to the parameter settings, and the result is that QPS divided by TPS gives the average number of statements executed per transaction.

| username: Raymond | Original post link

This method is not precise, as some statements might be automatically committed and not in the form of begin; dml statement; commit.

| username: 啦啦啦啦啦 | Original post link

Are there any scenarios that require precise values? In some scenarios, you can use parameters to control the types and number of SQL statements within a transaction.

| username: TiDBer_jYQINSnf | Original post link

The one replied by forever is correct. Each event counts as one TPS. That is, each execution of the event function counts as one TPS. Then, you can look at the code to see how many SQL statements are inside. Different scenarios will have different combinations of SQL statements.

| username: Raymond | Original post link

Okay, I’ll go check the code. Thank you, master.

| username: jansu-dev | Original post link

You can check this post
Need to look at the specific function, sysbench determines the number of SQLs for each transaction’s logic.

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.