Two MySQL partitions

Source: Internet
Author: User

The importance of MySQL partitions in MySQL databases is self-evident. So what is MySQL partition? What are the two methods for MySQL partitioning?

What is database partition? Database partitioning is a physical database design technology. DBA and database modeling personnel are quite familiar with it. Although partition technology can achieve a lot of results, its main purpose is to reduce the total amount of data read/write in a specific SQL operation to reduce the response time. There are two main MySQL partitions: // The concept of rows and columns: row and column)

Horizontal partition Horizontal Partitioning)

In this MySQL partition form, partitions are used to partition the rows of a table. In this way, datasets separated by physical columns in different groups can be combined to split individual data into single partitions) or group one or more partitions ). All columns defined in the table can be found in each dataset, so the table features are maintained.

For example:

A table containing ten-year invoice records can be partitioned into ten different partitions, each of which contains a one-year record. Peng Yi Note: here we will talk about the specific partitioning method. You can first talk about it. You must use an attribute column to separate it. For example, the column used here is the year)

Vertical partition Vertical Partitioning)

In general, this MySQL partition method reduces the width of the target table by vertical partitioning of the table, so that certain columns are divided into specific partitions, each partition contains the rows corresponding to the columns.

For example:

A table that contains large text and BLOB columns. These text and BLOB columns are not frequently accessed. In this case, we need to divide these infrequently used text and BLOB into another partition, while ensuring their data relevance, it can also increase the access speed.

When database vendors start to create partitions in their database engines, they must design the physical partition structure of the table, do not save redundant data. Different tables contain data in the parent table at the same time.) or join each other into a logical parent object, which is usually a view ). This method will invalidate most of the functions of the horizontal partition, and sometimes affect the vertical partition.

How to modify MySQL Environment Variables

Example of defining MySQL transactions

Example of creating a MySQL Stored Procedure

Use of mysql ifnull Functions

MySQL date functions


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.