Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 单表亿级的查询如何优化
【TiDB Usage Environment】Production Environment
【TiDB Version】5.4
【Reproduction Path】Nearly 100 million rows of data in a single table in the production environment, performing pagination queries
【Encountered Problem: Phenomenon and Impact】 Data return time is over 3 seconds
【Resource Configuration】
【Attachment: Screenshot/Log/Monitoring】
select
inc.*
from a inc
where 1=1 and inc.fault_status=1 and inc.error_alarm=0 and inc.block_state=0 ORDER BY inc.start_ts desc limit 10;