Streaming Queries in TiDB: TiDB Server Out of Memory

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

Original topic: TiDB流式查询,TiDB Server 内存溢出

| username: 大飞飞呀

【TiDB Usage Environment】Production Environment
【TiDB Version】
【Reproduction Path】What operations were performed when the issue occurred
TiDB streaming query, JDBC URI added parameter useCursorFetch=true

Table data volume is over 800 million, D_CREATED_AT has an index

Time range D_CREATED_AT < ‘2024-01-01 00:00:00’, data volume over 700 million, memory overflow
After modification
Time range D_CREATED_AT >= ‘2023-07-01 00:00:00’ and D_CREATED_AT < ‘2024-01-01 00:00:00’, data volume over 50 million, slight increase in memory
image
【Encountered Issue: Issue Phenomenon and Impact】
Why does streaming query cause memory overflow?
【Resource Configuration】Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
【Attachments: Screenshots/Logs/Monitoring】