Skip to content

[哈希分片]YYYYDD

jamie12221 edited this page Nov 29, 2020 · 1 revision

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

YYYYDD

仅用于分库

DD是一年之中的天数

(YYYY*366+DD)%分库数

create table travelrecord (
 ....
) ENGINE=InnoDB DEFAULT CHARSET=utf8 
dbpartition by YYYYMM(xxx) dbpartitions 8
tbpartition by xxx(xxx) tbpartitions 12;
Clone this wiki locally