1)按范分區(range)
partition by range(Year(birthday))( partition p0 values less than 1960, partition p1 values less than 1970, partition p2 values less than 1980, partition p3 values less than 1990, partition p4 values less than 2000 );
2)按類型分區(list)
partition by list(store_id)( partition p0 values in (1,2,3), partition p1 values in (4,5,6), partition p2 values in (7,8,9) );
3)無規則分區(hash)
partition by hash(id) partitions 5; 注意上面是"partitions",這個分區的意思是把所有記錄平均分配到5個數據庫分區裡