---
title: "MySql 分区"
author: "zerostar88"
date: "2015-04-22T16:48:13Z"
tags: []
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2015-04-22T16:48:13Z"
id: 2205112
url: "https://jeffyding.iteye.com/blog/2205112"
---

dev.mysql.com/doc/refman/5.6/en/partitioning-types.html

 

SELECT  
        PLUGIN\_NAME AS NAME,  
        PLUGIN\_VERSION AS VERSION,  
        PLUGIN\_STATUS AS STATUS  
    FROM INFORMATION\_SCHEMA.PLUGINS  
    WHERE PLUGIN\_TYPE='STORAGE ENGINE'; 

 

Name Version Status  
binlog 1.0 ACTIVE  
MEMORY 1.0 ACTIVE  
MyISAM 1.0 ACTIVE  
MRG\_MYISAM 1.0 ACTIVE  
CSV 1.0 ACTIVE  
InnoDB 5.6 ACTIVE  
FEDERATED 1.0 DISABLED  
PERFORMANCE\_SCHEMA 0.1 ACTIVE  
ARCHIVE 3.0 ACTIVE  
BLACKHOLE 1.0 ACTIVE  
partition 1.0 ACTIVE

 

- **RANGE partitioning.**  This type of partitioning assigns rows to partitions based on column values falling within a given range. See [Section 19.2.1, “RANGE Partitioning”](http://dev.mysql.com/doc/refman/5.6/en/partitioning-range.html "19.2.1 RANGE Partitioning"). For information about an extension to this type, `RANGE COLUMNS`, see [Section 19.2.3.1, “RANGE COLUMNS partitioning”](http://dev.mysql.com/doc/refman/5.6/en/partitioning-columns-range.html "19.2.3.1 RANGE COLUMNS partitioning").
- **LIST partitioning.**  Similar to partitioning by `RANGE`, except that the partition is selected based on columns matching one of a set of discrete values. See [Section 19.2.2, “LIST Partitioning”](http://dev.mysql.com/doc/refman/5.6/en/partitioning-list.html "19.2.2 LIST Partitioning"). For information about an extension to this type, `LIST COLUMNS`, see [Section 19.2.3.2, “LIST COLUMNS partitioning”](http://dev.mysql.com/doc/refman/5.6/en/partitioning-columns-list.html "19.2.3.2 LIST COLUMNS partitioning").
- **HASH partitioning.**  With this type of partitioning, a partition is selected based on the value returned by a user-defined expression that operates on column values in rows to be inserted into the table. The function may consist of any expression valid in MySQL that yields a nonnegative integer value. An extension to this type, `LINEAR HASH`, is also available. See [Section 19.2.4, “HASH Partitioning”](http://dev.mysql.com/doc/refman/5.6/en/partitioning-hash.html "19.2.4 HASH Partitioning").
- **KEY partitioning.**  This type of partitioning is similar to partitioning by `HASH`, except that only one or more columns to be evaluated are supplied, and the MySQL server provides its own hashing function. These columns can contain other than integer values, since the hashing function supplied by MySQL guarantees an integer result regardless of the column data type. An extension to this type, `LINEAR KEY`, is also available. See [Section 19.2.5, “KEY Partitioning”](http://dev.mysql.com/doc/refman/5.6/en/partitioning-key.html "19.2.5 KEY Partitioning").