TiDB SQL Slow Query

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb sql慢查询

| username: w958045214

Experts, there are over 1.8 billion rows of data in the TiDB table. Will counting (index field) result in a slow query?

| username: ddhe9527 | Original post link

Even if a field has an index, counting it still requires an index full scan (TiKV). The default threshold for slow queries is 300ms. If your hardware performance allows this count to return results within 300ms, it is not considered a slow query.

| username: w958045214 | Original post link

Thank you, master.

| username: Z六月星星 | Original post link

You can check the execution plan.

| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.