当前位置:网站首页>Mysql5.7 partition table
Mysql5.7 partition table
2022-06-12 09:20:00 【symop】
Alibaba cloud mysql Basic information
edition :5.7.32
To configure :2 nucleus 4G
Data sources :https://www.jianshu.com/p/d5d4fa4bd713
Table structure :
Partition table structure 
No partition table structure 
Data volume :1 Billion
Refer to a Fei's blog , website :https://www.jianshu.com/p/d5d4fa4bd713, A Fei's blog does not give a comparison of query performance before and after partitioning , Self test .
The following is the test primary key index
Test partition table sql
select * from employees_partition where job_no = ‘NO.8888891’;
Five times in a row :
0.288s
1.552s
1.367s
0.444s
0.461s
Test partition off cache sql
select SQL_NO_CACHE * from employees_partition where job_no =
‘NO.8888891’;
Five times in a row :
0.290s
0.438s
0.566s
0.533s
0.908s
Tests do not partition sql
select * from employees_nopartition where job_no = ‘NO.8888891’;
Five times in a row :
0.355s
0.440s
0.523s
0.326s
0.567s
Test closing cache without partitioning sql
select SQL_NO_CACHE * from employees_nopartition where job_no =
‘NO.8888891’;
Five times in a row :
0.477s
0.630s
0.325s
0.495s
0.285s
It is not found that partitioned tables have better performance than non partitioned queries .
If you are interested, you can self test the performance comparison of ordinary indexes .
Consider the worst case scenario of a large single table with large primary key fields , Let's calculate the main table b+ The height of the tree .
Like a single watch 100 Billion rows , Each row of data occupies an average of 1000 Byte storage space ,16KB Of page size, The main table page node will occupy about 10TB Space , about 7 Billion pages .
Suppose that the primary key index fetching is so stupid that each index row of the inner node occupies 512 byte , So the main table b+ The height of the tree is
1 + ceiling(lg(32, 700000000)) = 7
Assume that the above data only 1 Ten million lines , Then calculate the main table in the same way b+ The height of the tree is 5, Height difference 2.
Suppose the single table in the example 100 Yi did it 1000 Zones , Then through the partition , Can make each tree search reduce 2 Secondary page acquisition , This difference does lead to improved query performance , But the difference is not big .
On the other hand mysql5.7 In an earlier version , The implementation performance of partitioned table is poor , Compared with a single table with the same amount of data, the performance decreases by about 10%. Later on mysql5.7.19 To optimize , You can go to http://bugs.mysql.com Take a look at this bug. But even this bug After the repair , Partitioned tables are still about... Larger than single tables with the same amount of data 5% Performance degradation of (8 Zones ,100GB Data volume ,sysbench oltp Measurement example ).
above , It is not recommended to use mysql Partition table .
边栏推荐
- Test case and bug description specification reference
- 测试计划应该怎么写?一个思路教会你
- 软件测试基础知识分享,写点你不知道的
- Basic exercise decomposing prime factors
- 还在原地踏步,提高软件测试能力的方法你知道吗?
- 网络层IP协议 ARP&ICMP&IGMP NAT
- Source code and scheme for target recognition, detection and 6D attitude estimation (the most advanced method and data set)
- Semaphore flow control semaphore
- 解压缩zip文件的工具类
- Black screen solution for computer boot
猜你喜欢

More than 90% of the software companies will ask the software test interview questions. Hurry to recite them

node示例后台搭建
还在原地踏步,提高软件测试能力的方法你知道吗?

Node sample background setup

Machine learning notes - circular neural network memo list
![[computer use] how to change a computer disk into a mobile disk?](/img/ff/843f4220fcaefc00980a6edc29aebf.jpg)
[computer use] how to change a computer disk into a mobile disk?

Minimum transfer times
APP测试面试题汇总,面试必考一定要看
软件测试基础知识分享,写点你不知道的

Swagger documentation details
随机推荐
Use of MYCAT
帮助你拿到offer的金融测试面试题
I Regular expression to finite state automata: regular expression to NFA
Load the source code of 2D 3D virtual anchor in the web page (1: project introduction and source code)
Common omissions in software test reports, give yourself a wake-up call
L1-019 who goes first
[computer use] how to change a computer disk into a mobile disk?
MySQL - Import / export operation
【云原生】Eureka服务注册的搭建
ABC253F Operations on a Matrix
【云原生】具体指什么呢---此文和大伙儿分享答案
Mycat的使用
IV Transforming regular expressions into finite state automata: DFA minimization
Golandidea 2020.01 cracked version
Exists usage in SQL
JVM garbage collection
How to write test cases?
Do you know the meaning behind these questions?
Swagger documentation details
L1-002 print Hourglass (20 points)