Skip to content

[哈希分片]YYYYWEEK

jamie12221 edited this page Nov 29, 2020 · 1 revision

[数据分片]HASH型分片算法-YYYYWEEK

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;
Clone this wiki locally