阅读(1533) (15)

Mycat2 哈希分片 YYYYWEEK

2021-09-08 14:02:53 更新

YYYYWEEK

支持分库分表

(YYYY*54+WEEK)%分片数

WEEK的范围是1-53

java.time.temporal.WeekFields#weekOfWeekBasedYear

create table travelrecord (
 ....
) ENGINE=InnoDB DEFAULT CHARSET=utf8 
dbpartition by YYYYWEEK(xx) dbpartitions 8
tbpartition by xxx(xx) tbpartitions 12;