sevtin opened a new issue, #21845:
URL: https://github.com/apache/shardingsphere/issues/21845

   因为表的时间字段全部采用时间戳。是否可以通过时间戳进行水平分表?
   表结构如下
   ```
   CREATE TABLE `messages` (
     `srv_msg_id` bigint unsigned NOT NULL COMMENT '服务端消息号',
     `cli_msg_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '客户端消息号',
     `root_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '根消息id',
     `parent_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '父消息的id',
     `upper_message_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 
'合并转发消息中,上一层级的消息id srv_msg_id',
     `sender_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '发送者uid',
     `receiver_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '接收者uid',
     `sender_platform` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '发送者平台',
     `chat_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '会话ID',
     `chat_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '会话类型',
     `seq_id` int unsigned NOT NULL DEFAULT '0' COMMENT '消息唯一ID',
     `msg_from` int unsigned NOT NULL DEFAULT '0' COMMENT '消息来源',
     `msg_type` int unsigned NOT NULL DEFAULT '0' COMMENT '消息类型',
     `body` text CHARACTER SET utf8mb4 NOT NULL COMMENT '消息本体',
     `status` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '消息状态',
     `sent_ts` bigint NOT NULL DEFAULT '0' COMMENT '客户端本地发送时间',
     `srv_ts` bigint NOT NULL DEFAULT '0' COMMENT '服务端接收消息的时间',
     `updated_ts` bigint NOT NULL DEFAULT '0' COMMENT '更新时间',
     `deleted_ts` bigint NOT NULL DEFAULT '0' COMMENT '删除时间',
     PRIMARY KEY (`srv_msg_id`),
     UNIQUE KEY `srv_msg_id` (`srv_msg_id`),
     UNIQUE KEY `chatId_seqId` (`chat_id`,`seq_id`),
     KEY `idx_deletedTs` (`deleted_ts`),
     KEY `idx_chatId` (`chat_id`),
     KEY `idx_chatType` (`chat_type`),
     KEY `idx_senderId` (`sender_id`),
     KEY `idx_seqId` (`seq_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to