Horizontal partition and vertical database table mysql examples to explain the sub-table

mysql optimization statements have limitations, optimize mysql statement revolves around the index to optimize, then mysql if the index can not solve the massive data query slow the situation, then appear with the horizontal component and the vertical partition table table ( I just record your own understanding)

The level of sub-table:

\

Shown above: Another three-table structure is the same except that the data are stored in these three tables, so if you want to insert or query id are required to be taken over and then splicing table name, then it is a complete the table_name

But if I need to name it or divide table to email it?

Then you need to use MD5 encryption  because the MD5 encryption is hexadecimal then it can be taken apart, the idea above.

Vertical Table:

Why the need for vertical sub-table?

Because there is a big field and not have to show or not so although did not bother to inquire but when querying the index will be based on the id or other large fields together to find out, would seriously affect the current need to use a table if query performance, so only a vertical sub-table

Details see below:

\

These are the shortcomings of an idea of ​​the limited level of vertical sub-sub-table and the table, please indicate the level thanks

Guess you like

Origin www.cnblogs.com/liliuguang/p/10935763.html