tiDB 对单表的行数和体积有什么建议吗?查询时间和表的体积有什么样联系?有这种分析吗?
表结构大体如下:
CREATE TABLE tracking
(
id
bigint(20) unsigned NOT NULL AUTO_INCREMENT,
log_id
int,
channel_id
int,
tracking_status
int,
update_time
int,
ctime
int,
mtime
int,
) ENGINE=InnoDB AUTO_INCREMENT=1043796 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
插入 QPS 大体在1k~1w
查询sql:
select count(distinct(log_id)) from tracking where channel_id = xx and update_time > xx and update_time < xx and tracking_status in (xx);