56,940
社区成员




CREATE TABLE `demo_table` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`reward` int(11) NOT NULL DEFAULT '0',
`rules` varchar(255) NOT NULL DEFAULT '',
`created_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`sign_time` datetime DEFAULT NULL,
`replenish_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user_created_time` (`user_id`,`created_time`) USING HASH,
UNIQUE KEY `user_sign_time` (`user_id`,`sign_time`) USING BTREE,
KEY `user_id` (`user_id`) USING HASH,
KEY `created_time` (`created_time`) USING BTREE,
KEY `status` (`status`) USING BTREE,
KEY `status_created_time` (`status`,`created_time`) USING BTREE,
KEY `sign_time` (`sign_time`) USING BTREE,
KEY `status_replenish_time` (`status`,`replenish_time`) USING BTREE,
KEY `replenish_time` (`replenish_time`) USING BTREE,
KEY `user_replenish_time` (`user_id`,`replenish_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=66681184 DEFAULT CHARSET=utf8
explain DELETE FROM `demo_table` WHERE `user_id` = 884308 AND `sign_time` <= '2018-04-20 09:36:51' AND `status` = 0