MYSQL 表分区技术

HASH 分区

CREATE TABLE `partion2` ( `id` INT(10) NULL DEFAULT NULL ) COMMENT='11111' COLLATE='utf8_general_ci' ENGINE=MyISAM PARTITION BY HASH(id) PARTITIONS 4 ; 

LIST分区

CREATE TABLE `partion3` ( id int not null, store_id int(11) ) COMMENT='11111' COLLATE='utf8_general_ci' ENGINE=MyISAM PARTITION BY LIST(store_id) ( PARTITION p1 Values in(1,2,3), PARTITION p2 Values in(4,5,6), PARTITION p3 Values in(7,8,9) ) ; 

Range 分区

CREATE TABLE `partion4` ( id int not null, store_id int(11) ) COMMENT='11111' COLLATE='utf8_general_ci' ENGINE=MyISAM PARTITION BY RANGE(store_id) ( PARTITION p0 VALUES LESS THAN (1000), PARTITION p1 VALUES LESS THAN (2000), PARTITION p2 VALUES LESS THAN (3000), PARTITION p3 VALUES LESS THAN MAXVALUE ) ; 

你可能感兴趣的:(MYSQL 表分区技术)