mysql> SHOW VARIABLES LIKE '%partition%'; +-----------------------+-------+ |Variable_name | Value | +-----------------------+-------+ | have_partition_engine | YES | +-----------------------+-------+
mysql> SHOW PLUGINS; +----------------------------+----------+--------------------+---------+---------+ | Name | Status | Type | Library | License | +----------------------------+----------+--------------------+---------+---------+ | binlog | ACTIVE | STORAGE ENGINE | NULL | GPL | | mysql_native_password | ACTIVE | AUTHENTICATION | NULL | GPL | .................................................................................. | INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | INNODB_LOCK_WAITS | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | partition | ACTIVE | STORAGE ENGINE | NULL | GPL | +----------------------------+----------+--------------------+---------+---------+
mysql> use mytest; Database changed mysql> create table range_p( -> perid int(11), -> pername char(12) not null, -> monsalary DECIMAL(10,2), -> credate datetime -> ) partition by range(year(credate))( -> partition p2011 values less than (2011), -> partition p2012 values less than (2012), -> partition p2013 values less than (2013), -> partition p2014 values less than (2014), -> partition p2015 values less than maxvalue -> ); Query OK, 0 rows affected (0.12 sec)
mysql> create table list_p( -> perid int(11), -> pername char(12) not null, -> sex int(1) not null, -> monsalary DECIMAL(10,2), -> credate datetime -> ) partition by list(sex) ( -> partition psex1 values in(1), -> partition psex2 values in(2)); Query OK, 0 rows affected (0.06 sec)
create table hash_p( perid int(11), pername char(12) not null, sex int(1) not null, monsalary DECIMAL(10,2), credate datetime ) partition by hash (perid) partitions 8;
mysql> create table hash_p( -> perid int(11), -> pername char(12) not null, -> sex int(1) not null, -> monsalary DECIMAL(10,2), -> credate datetime -> ) partition by hash (year(credate)) -> partitions 8; Query OK, 0 rows affected (0.11 sec)
mysql> create table key_p( -> perid int(11), -> pername char(12) not null, -> sex int(1) not null, -> monsalary DECIMAL(10,2), -> credate datetime -> ) partition by key (perid) -> partitions 8; Query OK, 0 rows affected (0.12 sec)
mysql> create table range_p(
-> perid int(11),
-> pername char(12) not null,
-> monsalary DECIMAL(10,2),
-> credate datetime
-> ) PARTITION BY RANGE COLUMNS (credate)(
-> partition p20151 values less than ('2015-04-01'),
-> partition p20152 values less than ('2015-07-01'),
-> partition p20153 values less than ('2015-10-01'),
-> partition p20154 values less than ('2016-01-01'),
-> partition p20161 values less than ('2016-04-01'),
-> partition partlog values less than maxvalue
-> );
Query OK, 0 rows affected (0.12 sec)
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有