You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also use explain on the batch query (query.sql.log)
Repro steps
./risedev d full
# open localhost:3001, look at CN memory usage
psql -f create.sql.log
psql -f insert.sql.log
psql -f query.sql.log
# mem usage should spike
Observations
Halving the number of filter conditions also halves the mem usage.
Can try varying the PK as well.
Suggested next steps
Get a heap profile
The text was updated successfully, but these errors were encountered:
kwannoel
changed the title
Batch query with large filter condition, upstream MV with lots of keys fails
Batch query with large filter condition, upstream MV with lots of keys fails with CN OOM
Mar 12, 2024
I guess I have found the root cause of batch query OOM:
We have too many scan_ranges in RowSeqScan somehow (861 ranges in my reproduction). For each range, we will issue a range scan concurrently. The problem is that we don’t limit the concurrency, so there will be 861 tasks running at the same time, each has multiple array builders. They will consume a total of 861 ranges x 128 columns x 1024 rows x 4 bytes = 450MB memory. If we consider parallelism, it can easily eat up several GB.
Repro Scripts
create.sql.log
insert.sql.log
query.sql.log
python script to generate these: https://github.com/kwannoel/risingwave-dev-scripts/blob/main/wide_table.py.
You can generate versions to stdout with less row and columns to easily see the structure of the sql.
e.g.
You can also use
explain
on the batch query (query.sql.log
)Repro steps
Observations
Suggested next steps
Get a heap profile
The text was updated successfully, but these errors were encountered: