mysql分表详解(mysql自带)

#mysql分表详解#
1. 分表

首先要知道什么情况下,才需要分表个人觉得单表记录条数达到百万到千万级别时就要使用分表了,分表的目的就在于此,减小数据库的负担,缩短查询时间。

2. 分表方式

  • 水平分割

    表很大,其中表的某一行为枚举类,则可以使用水平切割。

  • 垂直切割

如果一个表中某些列常用,而另外一些列不常用,则可以采用垂直分割,另外垂直分割可以使得数据行变小,一个数据页就能存放更多的数据,在查询时就会减少I/O次数。 其缺点是需要管理冗余列,查询所有数据需要join操作。

3. 实践操作:按照省份分表(34个表)

  • 创建原有表

DROP TABLE IF EXISTS `WS_DOC`;
CREATE TABLE `WS_DOC` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `DOC_ID` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '文书网唯一ID',
  `DOC_TITLE` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '文书名称',
  `PUBLISH_DATE` date DEFAULT NULL COMMENT '发布日期',
  `CASE_CODE` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '案号',
  `CASE_COURT_ID` int(255) DEFAULT NULL COMMENT '法院id',
  `CASE_COURT` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '法院名称',
  `CASE_TYPE` int(11) DEFAULT NULL COMMENT '案件类型',
  `COURT_LOC` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '法院所属地',
  `COURT_LEVEL` int(11) DEFAULT NULL COMMENT '法院等级',
  `PROVINCE` varchar(16) CHARACTER SET utf8 DEFAULT NULL,
  `PROVINCE_ID` int(11) DEFAULT NULL COMMENT '省份id',
  `CASE_AY_ID` int(11) DEFAULT NULL COMMENT '案由id',
  `CASE_AY` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '案由',
  `TRIAL_ROUND` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '审理程序',
  `TRIAL_DATE` date DEFAULT NULL COMMENT '裁判日期',
  `JUDGE` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '法官,以,分割',
  `DOC_TYPE_ID` int(11) DEFAULT NULL COMMENT '文档类别id',
  `DOC_TYPE` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '文档类型',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `uk_doc_id` (`DOC_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  • 导入测试数据

  • 创建分表

BEGIN 
DECLARE `@i` int(11);
SET @str ="BEIJING,SHANGHAI,TIANJIN,CHONGQING,XIANGGANG,AOMEN,ANHUI,FUJIAN,GUANGDONG,GUANGXI,GUIZHOU,GANSU,HAINAN,HEBEI,HENAN,HEILONGJIANG,HUBEI,HUNAN,JILIN,JIANGSU,JIANGXI,LIAONING,NEIMENGGU,NINGXIA,QINGHAI,SHANXI,SHAANXI,SHANDONG,SICHUAN,TAIWAN,XIZANG,XINJIANG,YUNNAN,ZHEJIANG";
set `@i`=1; 
WHILE  `@i`< 35 DO                 
 SET @createSql = CONCAT(
'CREATE TABLE IF NOT EXISTS WS_DOC_',SUBSTRING_INDEX(SUBSTRING_INDEX(@str,',',`@i`),',',-1),
"(
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `DOC_ID` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '文书网唯一ID',
  `DOC_TITLE` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '文书名称',
  `PUBLISH_DATE` date DEFAULT NULL COMMENT '发布日期',
  `CASE_CODE` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '案号',
  `CASE_COURT_ID` int(255) DEFAULT NULL COMMENT '法院id',
  `CASE_COURT` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '法院名称',
  `CASE_TYPE` int(11) DEFAULT NULL COMMENT '案件类型',
  `COURT_LOC` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '法院所属地',
  `COURT_LEVEL` int(11) DEFAULT NULL COMMENT '法院等级',
  `PROVINCE` varchar(16) CHARACTER SET utf8 DEFAULT NULL,
  `PROVINCE_ID` int(11) DEFAULT NULL COMMENT '省份id',
  `CASE_AY_ID` int(11) DEFAULT NULL COMMENT '案由id',
  `CASE_AY` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '案由',
  `TRIAL_ROUND` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '审理程序',
  `TRIAL_DATE` date DEFAULT NULL COMMENT '裁判日期',
  `JUDGE` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '法官,以,分割',
  `DOC_TYPE_ID` int(11) DEFAULT NULL COMMENT '文档类别id',
  `DOC_TYPE` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '文档类型',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `uk_doc_id` (`DOC_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1
"); 
prepare stmt from @createSql; 
execute stmt;                                                 
SET `@i`= `@i`+1; 
END WHILE;
END
  • 创建主表

DROP TABLE IF EXISTS `WS_DOC`;
CREATE TABLE `WS_DOC_MAIN` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `DOC_ID` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '文书网唯一ID',
  `DOC_TITLE` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '文书名称',
  `PUBLISH_DATE` date DEFAULT NULL COMMENT '发布日期',
  `CASE_CODE` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '案号',
  `CASE_COURT_ID` int(255) DEFAULT NULL COMMENT '法院id',
  `CASE_COURT` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '法院名称',
  `CASE_TYPE` int(11) DEFAULT NULL COMMENT '案件类型',
  `COURT_LOC` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '法院所属地',
  `COURT_LEVEL` int(11) DEFAULT NULL COMMENT '法院等级',
  `PROVINCE` varchar(16) CHARACTER SET utf8 DEFAULT NULL,
  `PROVINCE_ID` int(11) DEFAULT NULL COMMENT '省份id',
  `CASE_AY_ID` int(11) DEFAULT NULL COMMENT '案由id',
  `CASE_AY` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '案由',
  `TRIAL_ROUND` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '审理程序',
  `TRIAL_DATE` date DEFAULT NULL COMMENT '裁判日期',
  `JUDGE` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '法官,以,分割',
  `DOC_TYPE_ID` int(11) DEFAULT NULL COMMENT '文档类别id',
  `DOC_TYPE` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '文档类型',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `uk_doc_id` (`DOC_ID`)
) ENGINE=MERGE UNION=(WS_DOC_BEIJING,WS_DOC_HANGHAI,WS_DOC_TIANJIN,WS_DOC_CHONGQING,WS_DOC_XIANGGANG,WS_DOC_AOMEN,WS_DOC_ANHUI,WS_DOC_FUJIAN,WS_DOC_GUANGDONG,WS_DOC_GUANGXI,WS_DOC_GUIZHOU,WS_DOC_GANSU,WS_DOC_HAINAN,WS_DOC_HEBEI,WS_DOC_HENAN,WS_DOC_HEILONGJIANG,WS_DOC_HUBEI,WS_DOC_HUNAN,WS_DOC_JILIN,WS_DOC_JIANGSU,WS_DOC_JIANGXI,WS_DOC_LIAONING,WS_DOC_NEIMENGGU,WS_DOC_NINGXIA,WS_DOC_QINGHAI,WS_DOC_SHANXI,WS_DOC_SHAANXI,WS_DOC_SHANDONG,WS_DOC_SICHUAN,WS_DOC_TAIWAN,WS_DOC_XIZANG,WS_DOC_XINJIANG,WS_DOC_YUNNAN,WS_DOC_ZHEJIANG) INSERT_METHOD=LAST AUTO_INCREMENT=1 ; 
  • 目标表数据分发

INSERT INTO WS_DOC_BEIJING (
	WS_DOC_BEIJING.ID,
	WS_DOC_BEIJING.DOC_ID,
	WS_DOC_BEIJING.DOC_TITLE,
	WS_DOC_BEIJING.PUBLISH_DATE,
	WS_DOC_BEIJING.CASE_CODE,
	WS_DOC_BEIJING.CASE_COURT_ID,
	WS_DOC_BEIJING.CASE_COURT,
	WS_DOC_BEIJING.CASE_TYPE,
	WS_DOC_BEIJING.COURT_LOC,
	WS_DOC_BEIJING.COURT_LEVEL,
	WS_DOC_BEIJING.PROVINCE,
	WS_DOC_BEIJING.CASE_AY_ID,
	WS_DOC_BEIJING.CASE_AY,
	WS_DOC_BEIJING.TRIAL_ROUND,
	WS_DOC_BEIJING.TRIAL_DATE,
	WS_DOC_BEIJING.JUDGE,
	WS_DOC_BEIJING.DOC_TYPE_ID,
	WS_DOC_BEIJING.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '北京';
INSERT INTO WS_DOC_SHANGHAI (
	WS_DOC_SHANGHAI.ID,
	WS_DOC_SHANGHAI.DOC_ID,
	WS_DOC_SHANGHAI.DOC_TITLE,
	WS_DOC_SHANGHAI.PUBLISH_DATE,
	WS_DOC_SHANGHAI.CASE_CODE,
	WS_DOC_SHANGHAI.CASE_COURT_ID,
	WS_DOC_SHANGHAI.CASE_COURT,
	WS_DOC_SHANGHAI.CASE_TYPE,
	WS_DOC_SHANGHAI.COURT_LOC,
	WS_DOC_SHANGHAI.COURT_LEVEL,
	WS_DOC_SHANGHAI.PROVINCE,
	WS_DOC_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C.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '天津';
INSERT INTO WS_DOC_CHONGQING (
	WS_DOC_CHONGQING.ID,
	WS_DOC_CHONGQING.DOC_ID,
	WS_DOC_CHONGQING.DOC_TITLE,
	WS_DOC_CHONGQING.PUBLISH_DATE,
	WS_DOC_CHONGQING.CASE_CODE,
	WS_DOC_CHONGQING.CASE_COURT_ID,
	WS_DOC_CHONGQING.CASE_COURT,
	WS_DOC_CHONGQING.CASE_TYPE,
	WS_DOC_CHONGQING.COURT_LOC,
	WS_DOC_CHONGQING.COURT_LEVEL,
	WS_DOC_CHONGQING.PROVINCE,
	WS_DOC_CHONGQING.CASE_AY_ID,
	WS_DOC_CHONGQING.CASE_AY,
	WS_DOC_CHONGQING.TRIAL_ROUND,
	WS_DOC_CHONGQING.TRIAL_DATE,
	WS_DOC_CHONGQING.JUDGE,
	WS_DOC_CHONGQING.DOC_TYPE_ID,
	WS_DOC_CHONGQING.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '重庆';
INSERT INTO WS_DOC_XIANGGANG (
	WS_DOC_XIANGGANG.ID,
	WS_DOC_XIANGGANG.DOC_ID,
	WS_DOC_XIANGGANG.DOC_TITLE,
	WS_DOC_XIANGGANG.PUBLISH_DATE,
	WS_DOC_XIANGGANG.CASE_CODE,
	WS_DOC_XIANGGANG.CASE_COURT_ID,
	WS_DOC_XIANGGANG.CASE_COURT,
	WS_DOC_XIANGGANG.CASE_TYPE,
	WS_DOC_XIANGGANG.COURT_LOC,
	WS_DOC_XIANGGANG.COURT_LEVEL,
	WS_DOC_XIANGGANG.PROVINCE,
	WS_DOC_XIANGGANG.CASE_AY_ID,
	WS_DOC_XIANGGANG.CASE_AY,
	WS_DOC_XIANGGANG.TRIAL_ROUND,
	WS_DOC_XIANGGANG.TRIAL_DATE,
	WS_DOC_XIANGGANG.JUDGE,
	WS_DOC_XIANGGANG.DOC_TYPE_ID,
	WS_DOC_XIANGGANG.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '香港';
INSERT INTO WS_DOC_AOMEN (
	WS_DOC_AOMEN.ID,
	WS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OC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '福建';
INSERT INTO WS_DOC_GUANGDONG (
	WS_DOC_GUANGDONG.ID,
	WS_DOC_GUANGDONG.DOC_ID,
	WS_DOC_GUANGDONG.DOC_TITLE,
	WS_DOC_GUANGDONG.PUBLISH_DATE,
	WS_DOC_GUANGDONG.CASE_CODE,
	WS_DOC_GUANGDONG.CASE_COURT_ID,
	WS_DOC_GUANGDONG.CASE_COURT,
	WS_DOC_GUANGDONG.CASE_TYPE,
	WS_DOC_GUANGDONG.COURT_LOC,
	WS_DOC_GUANGDONG.COURT_LEVEL,
	WS_DOC_GUANGDONG.PROVINCE,
	WS_DOC_GUANGDONG.CASE_AY_ID,
	WS_DOC_GUANGDONG.CASE_AY,
	WS_DOC_GUANGDONG.TRIAL_ROUND,
	WS_DOC_GUANGDONG.TRIAL_DATE,
	WS_DOC_GUANGDONG.JUDGE,
	WS_DOC_GUANGDONG.DOC_TYPE_ID,
	WS_DOC_GUANGDONG.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '广东';
INSERT INTO WS_DOC_GUANGXI (
	WS_DOC_GUANGXI.ID,
	WS_DOC_GUANGXI.DOC_ID,
	WS_DOC_GUANGXI.DOC_TITLE,
	WS_DOC_GUANGXI.PUBLISH_DATE,
	WS_DOC_GUANGXI.CASE_CODE,
	WS_DOC_GUANGXI.CASE_COURT_ID,
	WS_DOC_GUANGXI.CASE_COURT,
	WS_DOC_GUANGXI.CASE_TYPE,
	WS_DOC_GUANGXI.COURT_LOC,
	WS_DOC_GUANGXI.COURT_LEVEL,
	WS_DOC_GUANGXI.PROVINCE,
	WS_DOC_GUANGXI.CASE_AY_ID,
	WS_DOC_GUANGXI.CASE_AY,
	WS_DOC_GUANGXI.TRIAL_ROUND,
	WS_DOC_GUANGXI.TRIAL_DATE,
	WS_DOC_GUANGXI.JUDGE,
	WS_DOC_GUANGXI.DOC_TYPE_ID,
	WS_DOC_GUANGXI.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '广西';
INSERT INTO WS_DOC_GUIZHOU (
	WS_DOC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WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '河北';
INSERT INTO WS_DOC_HENAN (
	WS_DOC_HENAN.ID,
	WS_DOC_HENAN.DOC_ID,
	WS_DOC_HENAN.DOC_TITLE,
	WS_DOC_HENAN.PUBLISH_DATE,
	WS_DOC_HENAN.CASE_CODE,
	WS_DOC_HENAN.CASE_COURT_ID,
	WS_DOC_HENAN.CASE_COURT,
	WS_DOC_HENAN.CASE_TYPE,
	WS_DOC_HENAN.COURT_LOC,
	WS_DOC_HENAN.COURT_LEVEL,
	WS_DOC_HENAN.PROVINCE,
	WS_DOC_HENAN.CASE_AY_ID,
	WS_DOC_HENAN.CASE_AY,
	WS_DOC_HENAN.TRIAL_ROUND,
	WS_DOC_HENAN.TRIAL_DATE,
	WS_DOC_HENAN.JUDGE,
	WS_DOC_HENAN.DOC_TYPE_ID,
	WS_DOC_HENAN.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '河南';
INSERT INTO WS_DOC_HEILONGJIANG (
	WS_DOC_HEILONGJIANG.ID,
	WS_DOC_HEILONGJIANG.DOC_ID,
	WS_DOC_HEILONGJIANG.DOC_TITLE,
	WS_DOC_HEILONGJIANG.PUBLISH_DATE,
	WS_DOC_HEILONGJIANG.CASE_CODE,
	WS_DOC_HEILONGJIANG.CASE_COURT_ID,
	WS_DOC_HEILONGJIANG.CASE_COURT,
	WS_DOC_HEILONGJIANG.CASE_TYPE,
	WS_DOC_HEILONGJIANG.COURT_LOC,
	WS_DOC_HEILONGJIANG.COURT_LEVEL,
	WS_DOC_HEILONGJIANG.PROVINCE,
	WS_DOC_HEILONGJIANG.CASE_AY_ID,
	WS_DOC_HEILONGJIANG.CASE_AY,
	WS_DOC_HEILONGJIANG.TRIAL_ROUND,
	WS_DOC_HEILONGJIANG.TRIAL_DATE,
	WS_DOC_HEILONGJIANG.JUDGE,
	WS_DOC_HEILONGJIANG.DOC_TYPE_ID,
	WS_DOC_HEILONGJIANG.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '黑龙江';
INSERT INTO WS_DOC_HUBEI (
	WS_DOC_HUBEI.ID,
	WS_DOC_HUBEI.DOC_ID,
	WS_DOC_HUBEI.DOC_TITLE,
	WS_DOC_HUBEI.PUBLISH_DATE,
	WS_DOC_HUBEI.CASE_CODE,
	WS_DOC_HUBEI.CASE_COURT_ID,
	WS_DOC_HUBEI.CASE_COURT,
	WS_DOC_HUBEI.CASE_TYPE,
	WS_DOC_HUBEI.COURT_LOC,
	W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ECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '湖南';
INSERT INTO WS_DOC_JILIN (
	WS_DOC_JILIN.ID,
	WS_DOC_JILIN.DOC_ID,
	WS_DOC_JILIN.DOC_TITLE,
	WS_DOC_JILIN.PUBLISH_DATE,
	WS_DOC_JILIN.CASE_CODE,
	WS_DOC_JILIN.CASE_COURT_ID,
	WS_DOC_JILIN.CASE_COURT,
	WS_DOC_JILIN.CASE_TYPE,
	WS_DOC_JILIN.COURT_LOC,
	WS_DOC_JILIN.COURT_LEVEL,
	WS_DOC_JILIN.PROVINCE,
	WS_DOC_JILIN.CASE_AY_ID,
	WS_DOC_JILIN.CASE_AY,
	WS_DOC_JILIN.TRIAL_ROUND,
	WS_DOC_JILIN.TRIAL_DATE,
	WS_DOC_JILIN.JUDGE,
	WS_DOC_JILIN.DOC_TYPE_ID,
	WS_DOC_JILIN.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '吉林';
INSERT INTO WS_DOC_JIANGSU (
	WS_DOC_JIANGSU.ID,
	WS_DOC_JIANGSU.DOC_ID,
	WS_DOC_JIANGSU.DOC_TITLE,
	WS_DOC_JIANGSU.PUBLISH_DATE,
	WS_DOC_JIANGSU.CASE_CODE,
	WS_DOC_JIANGSU.CASE_COURT_ID,
	WS_DOC_JIANGSU.CASE_COURT,
	WS_DOC_JIANGSU.CASE_TYPE,
	WS_DOC_JIANGSU.COURT_LOC,
	WS_DOC_JIANGSU.COURT_LEVEL,
	WS_DOC_JIANGSU.PROVINCE,
	WS_DOC_JIANGSU.CASE_AY_ID,
	WS_DOC_JIANGSU.CASE_AY,
	WS_DOC_JIANGSU.TRIAL_ROUND,
	WS_DOC_JIANGSU.TRIAL_DATE,
	WS_DOC_JIANGSU.JUDGE,
	WS_DOC_JIANGSU.DOC_TYPE_ID,
	WS_DOC_JIANGSU.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '江苏';
INSERT INTO WS_DOC_JIANGXI (
	WS_DOC_JIANGXI.ID,
	WS_DOC_JIANGXI.DOC_ID,
	WS_DOC_JIANGXI.DOC_TITLE,
	WS_DOC_JIANGXI.PUBLISH_DATE,
	WS_DOC_JIANGXI.CASE_CODE,
	WS_DOC_JIANGXI.CASE_COURT_ID,
	WS_DOC_JIANGXI.CASE_COURT,
	WS_DOC_JIANGXI.CASE_TYPE,
	WS_DOC_JIANGXI.COURT_LOC,
	WS_DOC_JIANGXI.COURT_LEVEL,
	WS_DOC_JIANGXI.PROVINCE,
	WS_DOC_JIANGXI.CASE_AY_ID,
	WS_DOC_JIANGXI.CASE_AY,
	WS_DOC_JIANGXI.TRIAL_ROUND,
	WS_DOC_JIANGXI.TRIAL_DATE,
	WS_DOC_JIANGXI.JUDGE,
	WS_DOC_JIANGXI.DOC_TYPE_ID,
	WS_DOC_JIANGXI.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '江西';
INSERT INTO WS_DOC_LIAONING (
	WS_DOC_LIAONING.ID,
	WS_DOC_LIAONING.DOC_ID,
	WS_DOC_LIAONING.DOC_TITLE,
	WS_DOC_LIAONING.PUBLISH_DATE,
	WS_DOC_LIAONING.CASE_CODE,
	WS_DOC_LIAONING.CASE_COURT_ID,
	WS_DOC_LIAONING.CASE_COURT,
	WS_DOC_LIAONING.CASE_TYPE,
	WS_DOC_LIAONING.COURT_LOC,
	WS_DOC_LIAONING.COURT_LEVEL,
	WS_DOC_LIAONING.PROVINCE,
	WS_DOC_LIAONING.CASE_AY_ID,
	WS_DOC_LIAONING.CASE_AY,
	WS_DOC_LIAONING.TRIAL_ROUND,
	WS_DOC_LIAONING.TRIAL_DATE,
	WS_DOC_LIAONING.JUDGE,
	WS_DOC_LIAONING.DOC_TYPE_ID,
	WS_DOC_LIAONING.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '辽宁';
INSERT INTO WS_DOC_NEIMENGGU (
	WS_DOC_NEIMENGGU.ID,
	WS_DOC_NEIMENGGU.DOC_ID,
	WS_DOC_NEIMENGGU.DOC_TITLE,
	WS_DOC_NEIMENGGU.PUBLISH_DATE,
	WS_DOC_NEIMENGGU.CASE_CODE,
	WS_DOC_NEIMENGGU.CASE_COURT_ID,
	WS_DOC_NEIMENGGU.CASE_COURT,
	WS_DOC_NEIMENGGU.CASE_TYPE,
	WS_DOC_NEIMENGGU.COURT_LOC,
	WS_DOC_NEIMENGGU.COURT_LEVEL,
	WS_DOC_NEIMENGGU.PROVINCE,
	WS_DOC_NEIMENGGU.CASE_AY_ID,
	WS_DOC_NEIMENGGU.CASE_AY,
	WS_DOC_NEIMENGGU.TRIAL_ROUND,
	WS_DOC_NEIMENGGU.TRIAL_DATE,
	WS_DOC_NEIMENGGU.JUDGE,
	WS_DOC_NEIMENGGU.DOC_TYPE_ID,
	WS_DOC_NEIMENG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DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '宁夏';
INSERT INTO WS_DOC_QINGHAI (
	WS_DOC_QINGHAI.ID,
	WS_DOC_QINGHAI.DOC_ID,
	WS_DOC_QINGHAI.DOC_TITLE,
	WS_DOC_QINGHAI.PUBLISH_DATE,
	WS_DOC_QINGHAI.CASE_CODE,
	WS_DOC_QINGHAI.CASE_COURT_ID,
	WS_DOC_QINGHAI.CASE_COURT,
	WS_DOC_QINGHAI.CASE_TYPE,
	WS_DOC_QINGHAI.COURT_LOC,
	WS_DOC_QINGHAI.COURT_LEVEL,
	WS_DOC_QINGHAI.PROVINCE,
	WS_DOC_QINGHAI.CASE_AY_ID,
	WS_DOC_QINGHAI.CASE_AY,
	WS_DOC_QINGHAI.TRIAL_ROUND,
	WS_DOC_QINGHAI.TRIAL_DATE,
	WS_DOC_QINGHAI.JUDGE,
	WS_DOC_QINGHAI.DOC_TYPE_ID,
	WS_DOC_QINGHAI.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '青海';
INSERT INTO WS_DOC_SHANXI (
	WS_DOC_SHANXI.ID,
	WS_DOC_SHANXI.DOC_ID,
	WS_DOC_SHANXI.DOC_TITLE,
	WS_DOC_SHANXI.PUBLISH_DATE,
	WS_DOC_SHANXI.CASE_CODE,
	WS_DOC_SHANXI.CASE_COURT_ID,
	WS_DOC_SHANXI.CASE_COURT,
	WS_DOC_SHANXI.CASE_TYPE,
	WS_DOC_SHANXI.COURT_LOC,
	WS_DOC_SHANXI.COURT_LEVEL,
	WS_DOC_SHANXI.PROVINCE,
	WS_DOC_SHANXI.CASE_AY_ID,
	WS_DOC_SHANXI.CASE_AY,
	WS_DOC_SHANXI.TRIAL_ROUND,
	WS_DOC_SHANXI.TRIAL_DATE,
	WS_DOC_SHANXI.JUDGE,
	WS_DOC_SHANXI.DOC_TYPE_ID,
	WS_DOC_SHANXI.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '山西';
INSERT INTO WS_DOC_SHANXI (
	WS_DOC_SHANXI.ID,
	WS_DOC_SHANXI.DOC_ID,
	WS_DOC_SHANXI.DOC_TITLE,
	WS_DOC_SHANXI.PUBLISH_DATE,
	WS_DOC_SHANXI.CASE_CODE,
	WS_DOC_SHANXI.CASE_COURT_ID,
	WS_DOC_SHANXI.CASE_COURT,
	WS_DOC_SHANXI.CASE_TYPE,
	WS_DOC_SHANXI.COURT_LOC,
	WS_DOC_SHANXI.COURT_LEVEL,
	WS_DOC_SHANXI.PROVINCE,
	WS_DOC_SHANXI.CASE_AY_ID,
	WS_DOC_SHANXI.CASE_AY,
	WS_DOC_SHANXI.TRIAL_ROUND,
	WS_DOC_SHANXI.TRIAL_DATE,
	WS_DOC_SHANXI.JUDGE,
	WS_DOC_SHANXI.DOC_TYPE_ID,
	WS_DOC_SHANXI.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '陕西';
INSERT INTO WS_DOC_SHANDONG (
	WS_DOC_SHANDONG.ID,
	WS_DOC_SHANDONG.DOC_ID,
	WS_DOC_SHANDONG.DOC_TITLE,
	WS_DOC_SHANDONG.PUBLISH_DATE,
	WS_DOC_SHANDONG.CASE_CODE,
	WS_DOC_SHANDONG.CASE_COURT_ID,
	WS_DOC_SHANDONG.CASE_COURT,
	WS_DOC_SHANDONG.CASE_TYPE,
	WS_DOC_SHANDONG.COURT_LOC,
	WS_DOC_SHANDONG.COURT_LEVEL,
	WS_DOC_SHANDONG.PROVINCE,
	WS_DOC_SHANDONG.CASE_AY_ID,
	WS_DOC_SHANDONG.CASE_AY,
	WS_DOC_SHANDONG.TRIAL_ROUND,
	WS_DOC_SHANDONG.TRIAL_DATE,
	WS_DOC_SHANDONG.JUDGE,
	WS_DOC_SHANDONG.DOC_TYPE_ID,
	WS_DOC_SHANDONG.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '山东';
INSERT INTO WS_DOC_SICHUAN (
	WS_DOC_SICHUAN.ID,
	WS_DOC_SICHUAN.DOC_ID,
	WS_DOC_SICHUAN.DOC_TITLE,
	WS_DOC_SICHUAN.PUBLISH_DATE,
	WS_DOC_SICHUAN.CASE_CODE,
	WS_DOC_SICHUAN.CASE_COURT_ID,
	WS_DOC_SICHUAN.CASE_COURT,
	WS_DOC_SICHUAN.CASE_TYPE,
	WS_DOC_SICHUAN.COURT_LOC,
	WS_DOC_SICHUAN.COURT_LEVEL,
	WS_DOC_SICHUAN.PROVINCE,
	WS_DOC_SICHUAN.CASE_AY_ID,
	WS_DOC_SICHUAN.CASE_AY,
	WS_DOC_SICHUAN.TRIAL_ROUND,
	WS_DOC_SICHUAN.TRIAL_DATE,
	WS_DOC_SICHUAN.JUDGE,
	WS_DOC_SICHUAN.DOC_TYPE_ID,
	WS_DOC_SICHUAN.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PRO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_XIZANG.ID,
	WS_DOC_XIZANG.DOC_ID,
	WS_DOC_XIZANG.DOC_TITLE,
	WS_DOC_XIZANG.PUBLISH_DATE,
	WS_DOC_XIZANG.CASE_CODE,
	WS_DOC_XIZANG.CASE_COURT_ID,
	WS_DOC_XIZANG.CASE_COURT,
	WS_DOC_XIZANG.CASE_TYPE,
	WS_DOC_XIZANG.COURT_LOC,
	WS_DOC_XIZANG.COURT_LEVEL,
	WS_DOC_XIZANG.PROVINCE,
	WS_DOC_XIZANG.CASE_AY_ID,
	WS_DOC_XIZANG.CASE_AY,
	WS_DOC_XIZANG.TRIAL_ROUND,
	WS_DOC_XIZANG.TRIAL_DATE,
	WS_DOC_XIZANG.JUDGE,
	WS_DOC_XIZANG.DOC_TYPE_ID,
	WS_DOC_XIZANG.DOC_TYPE
) SELECT
	WS_DOC.ID,
	WS_DOC.DOC_ID,
	WS_DOC.DOC_TITLE,
	WS_DOC.PUBLISH_DATE,
	WS_DOC.CASE_CODE,
	WS_DOC.CASE_COURT_ID,
	WS_DOC.CASE_COURT,
	WS_DOC.CASE_TYPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '西藏';
INSERT INTO WS_DOC_XINJIANG (
	WS_DOC_XINJIANG.ID,
	WS_DOC_XINJIANG.DOC_ID,
	WS_DOC_XINJIANG.DOC_TITLE,
	WS_DOC_XINJIANG.PUBLISH_DATE,
	WS_DOC_XINJIANG.CASE_CODE,
	WS_DOC_XINJIANG.CASE_COURT_ID,
	WS_DOC_XINJIANG.CASE_COURT,
	WS_DOC_XINJIANG.CASE_TYPE,
	WS_DOC_XINJIANG.COURT_LOC,
	WS_D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YPE,
	WS_DOC.COURT_LOC,
	WS_DOC.COURT_LEVEL,
	WS_DOC.PROVINCE,
	WS_DOC.CASE_AY_ID,
	WS_DOC.CASE_AY,
	WS_DOC.TRIAL_ROUND,
	WS_DOC.TRIAL_DATE,
	WS_DOC.JUDGE,
	WS_DOC.DOC_TYPE_ID,
	WS_DOC.DOC_TYPE
FROM
	WS_DOC
WHERE
	WS_DOC.PROVINCE = '浙江';
  • 测试结果

  • 结论

实际操作中如果使用mysql原有的分表方式,最简单,但是也过于局限。
只能实现对现有数据库表中的数据分表,如果表数据是实时增加的,需要手动插入这n个表,代码繁琐。
可以采取mycat的方式进行单库分表,mycat最低版本为1.6.5,后续会实验操作mycat说明。
如果想试验的,提供本文的所有sql:
https://pan.baidu.com/s/1-MejB8liUduz-tUjTvVKww

你可能感兴趣的:(mysql)