In this era of big data, a large amount of data poured into the database. Users put forward higher requirements for database access performance. Upgrading of database access performance is necessary.
How to upgrade the database correctly? We need to know what is the bottleneck of database performance development. What causes users to Caton when using the database? Where is the phenomenon of data transmission jamming and crash? We will solve these problems in a targeted way. In order to find the performance bottleneck of the database. We need to know the basic hardware performance indicators of our computer.
The figure indicates that each device has two indicators. Delay (response time): The burst processing capability of hardware. Bandwidth (Throughput): Hardware Continuous Processing Capacity. The performance of computer system hardware from high to low is. CPU-Cache (L1-L2-L3)-Memory-SSD hard disk-Network-hard disk.
According to the database knowledge, we can list the work content of each hardware:
CPU and memory: cache data access, comparison, sorting. Transaction detection. SQL parsing. Functions or logical operations.
Network: result data transmission. SQL request. Remote database access.
Hard disk: data access, data write. Logging. Sorting large amounts of data. Large table connection.
According to the basic performance index of computer hardware and its main operation contents in the database. We can sort out the basic performance upgrade rules:
The rule can be summarized into five levels:
1. Reduce data access (reduce disk access)
2. Return fewer data (reduce network transmission or disk access)
3. Reduce the number of interactions (reduce network transmission)
4. Reduce server CPU overhead (reduce CPU and memory overhead)
5. Use more resources (increase resources)
Each layer of methods is targeted to solve performance problems. Its final effect is different. The traditional design is to provide upgrade methods for low-speed equipment as much as possible. There are more ways to optimize the problem of low-speed equipment. The cost is low. The performance upgrade of any SQL should follow this rule. Diagnose problems from top to bottom and propose solutions.
Estimation of effect and input cost corresponding to each upgrade rule:
Upgrade rule |
Performance Improvement Effect |
Upgrade Cost |
Reduce data access |
1~1000 |
Low |
Return fewer data |
1~100 |
Low |
Reduce the number of interactions |
1~20 |
Low |
Reduce server CPU overhead |
1~5 |
Low |
Use more resources |
0~10 |
High |
This article introduces the upgrade of database access performance. We got the knowledge of the hardware and a solution. Upgrade of database access performance is required by the times. This is what users need. In the trend of the times, the database will need more performance upgrade. Only through continuous upgrade can it survive for a long time.