In my previous article, I said that the optimization of MySQL statements has limitations. The optimization of MySQL statements revolves around index optimization. If the index in MySQL cannot solve the problem of slow query of massive data, then horizontal and vertical table partitioning will appear (I just record my understanding) Horizontal table: As shown in the figure above: The other three tables have the same structure, except that the data is stored separately in these three tables. If you want to insert or query, you need to take the modulus of the id and then concatenate the table names, so that a complete table_name But what if I need to separate the name table or the email? Then you need to use MD5 to encrypt because the encrypted MD5 number is in hexadecimal, so you can take the remainder, the idea is the same as above. Vertical table: Why is vertical partitioning necessary? Because if there is a large field in a table that does not need to be displayed or is not currently needed, then even if it is not deliberately queried, when querying based on ID or other indexes, the large field will be found together, which will seriously affect the query performance. Therefore, vertical partitioning is used. Please see the following figure for details: The above is an idea of horizontal and vertical table division. Please point out any shortcomings. Thank you. Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: How to use native JS to implement touch sliding monitoring events
>>: How to run top command in batch mode
Table of contents 1. Block scope 1.1. let replace...
Assuming you are a linuxer , we don't want to...
Today, I encountered a small problem that after s...
This article shares the specific code of js to re...
This article uses examples to describe the creati...
There are two situations 1. Start time and end ti...
1. Download and unzip to: /Users/xiechunping/Soft...
Let's start with a description of the problem...
Preface I feel like my mind is empty lately, as I...
Author: Guan Changlong is a DBA in the Delivery S...
Table of contents Previous 1. What is setup synta...
If you don't have a Linux system, please refe...
<br />I have written two articles before, &q...
Table of contents Storage Engine Memory Managemen...
Install memcached yum install -y memcached #Start...