Memory Usage Confusion

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

Original topic: 内存使用疑惑

| username: 等一分钟

The maximum memory limit for a single SQL is 1G. How can it use so much memory?

| username: TiDBer_小阿飞 | Original post link

| username: Miracle | Original post link

The parameter that limits the memory of a single SQL seems to sometimes take effect and sometimes not.

| username: 等一分钟 | Original post link

The server doesn’t even have 95GB of memory, how can it use that much?

| username: TiDBer_小阿飞 | Original post link

It only shows that your table hasn’t reached the required scale! TiDB was originally designed for fast query analysis and transaction processing of massive data, HTAP, so a single SQL query of one gigabyte is nothing. After all, their benchmark now starts at trillions of data points… :rofl:

| username: Miracle | Original post link

Did the statement that used 95GB of memory execute successfully? Did TiDB experience an OOM (Out of Memory) issue?

| username: 等一分钟 | Original post link

There are too many machines, didn’t look closely, there might be an OOM.

| username: TiDBer_小阿飞 | Original post link

How about using explain analyze?