Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: COUNT(id) 进行了全表扫描怎么优化

【TiDB Usage Environment】Production Environment
【TiDB Version】
【Reproduction Path】What operations were performed when the issue occurred
【Encountered Issue: Problem Phenomenon and Impact】40 million data volume, count(id), takes 2 seconds
【Resource Configuration】
【Attachment: Screenshot/Log/Monitoring】