Skip to content

Commit

Permalink
performance-tuning-practices: fix wrong number (pingcap#19125) (pingc…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Oct 16, 2024
1 parent 5fcbc62 commit babe060
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions performance-tuning-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,13 @@ The following table lists the performance of seven different scenarios.

| Metrics | Scenario 1 | Scenario 2 | Scenario 3 | Scenario 4 | Scenario 5 | Scenario 6 | Scenario 7 | Comparing Scenario 5 with Scenario 2 (%) | Comparing Scenario 7 with Scenario 3 (%) |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| query duration | 479μs | 1120μs | 528μs | 426μs |690μs | 533μs | 313μs | -38% | -51% |
| query duration | 479μs | 1120μs | 528μs | 426μs |690μs | 533μs | 313μs | -38% | -41% |
| QPS | 56.3k | 24.2k | 19.7k | 22.1k | 30.9k | 34.9k | 40.9k | +28% | +108% |

In these scenarios, Scenario 2 is a common scenario where applications use the Query interface, and Scenario 5 is an ideal scenario where applications use the Prepared Statement interface.

- Comparing Scenario 2 with Scenario 5, you can see that by using best practices for Java application development and caching Prepared Statement objects on the client side, each SQL statement requires only one command and database interaction to hit the execution plan cache, which results in a 38% drop in query latency and a 28% increase in QPS, while the average TiDB CPU utilization drops from 936% to 577%.
- Comparing Scenario 2 with Scenario 7, you can see that with the latest TiDB optimization features such as RC Read and small table cache on top of Scenario 5, latency is reduced by 51% and QPS is increased by 108%, while the average TiDB CPU utilization drops from 936% to 478%.
- Comparing Scenario 5 with Scenario 2, you can see that by using best practices for Java application development and caching Prepared Statement objects on the client side, each SQL statement requires only one command and database interaction to hit the execution plan cache, which results in a 38% drop in query latency and a 28% increase in QPS, while the average TiDB CPU utilization drops from 936% to 577%.
- Comparing Scenario 7 with Scenario 3, you can see that with the latest TiDB optimization features such as RC Read and small table cache on top of Scenario 5, latency is reduced by 41% and QPS is increased by 108%, while the average TiDB CPU utilization drops from 936% to 478%.

By comparing the performance of each scenario, we can draw the following conclusions:

Expand Down

0 comments on commit babe060

Please sign in to comment.