PolarDB的select,每次都扫描都是大几十万行,怎么处理?

PolarDB的select,每次都扫描都是大几十万行,怎么处理?MySQL [domain_db]> select count() from user_train_list;
+----------+
| count(
) |
+----------+
| 1074992 |
+----------+
1 row in set (0.163 sec)

MySQL [domain_db]> select count() from user_train_list where traintype = 1;
+----------+
| count(
) |
+----------+
| 1067965 |
+----------+
1 row in set (0.190 sec)

MySQL [domain_db]> select count() from user_train_list where traintype = 1 and 2 > robTimes;
+----------+
| count(
) |
+----------+
| 932975 |
+----------+
1 row in set (0.224 sec)

MySQL [domain_db]> select count() from user_train_list where traintype = 1 and arriveTime > 1720421130477;
+----------+
| count(
) |
+----------+
| 1062140 |
+----------+

展开
收起
三分钟热度的鱼 2024-07-18 08:48:42 75 发布于安徽 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答

阿里云关系型数据库主要有以下几种:RDS MySQL版、RDS PostgreSQL 版、RDS SQL Server 版、PolarDB MySQL版、PolarDB PostgreSQL 版、PolarDB分布式版 。

还有其他疑问?
咨询AI助理
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等