@
liprais 你好,针对分区咨询你个问题!
我把原先表按星期几分区后
ALTER TABLE tb_heartbeat PARTITION BY RANGE(WEEKDAY(hbTime))(
PARTITION p1 VALUES less than (1),
PARTITION p2 VALUES less than (2),
PARTITION p3 VALUES less than (3),
PARTITION p4 VALUES less than (4),
PARTITION p5 VALUES less than (5),
PARTITION p6 VALUES less than (6),
PARTITION p7 VALUES less than (MAXVALUE)
);
但是在查询今天数据的时候,它会遍历所有分区。
EXPLAIN PARTITIONS SELECT * from tb_heartbeat where hbtime < '2019-08-29 23:59:59' and hbtime > '2019-08-29 00:00:20'
这个应该是什么问题,看了文档没找到相关的
谢谢