create table 表名(
`id` int(11) auto_increment,
`name` varchar(50),
`store_id` int, //关联id
primary key(`id`,`store_id`) //复合索引
)engine=myisam charset=utf8
partition by list(store_id)( //可以是年
partition p1 values in (7,8,9),
partition p2 values in (4,5,6),
partition p3 values in (789)
);
explain partition select * from 表名 where store_id = 7; //查看是否用到了分区