duckdb / duckdb/duckdb-java

One goofy SELECT can freeze the computer hard

Open
#29 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
127
Forks
80
Avg merge
13h 49m
Merged PRs (30d)
48

Description

Greetings!

I do understand well the memory constraints and what happens when you cross-multiply large tables. I also understand, that DuckDB gives the power to its user to set the memory correctly. So far so good.

However, I just froze my linux machine -- twice! -- by running an unlimited cross select -- and I feel like this should not happen, especially when running in/from a Java environment (although its just a JNI bridge really).

Example is Amazon Redshift's TickDB:

```sql
are@ryzen ~ [1]> duckdb Documents/JSQLTranspiler/.manticore/JSQLTranspilerTest.duckdb
v0.10.3 70fd6a8a24
Enter ".help" for usage hints.
D select count(*) from sales
;
┌──────────────┐
│ count_star() │
│ int64 │
├──────────────┤
│ 172456 │
└──────────────┘

D select count(*) from listing;
┌──────────────┐
│ count_star() │
│ int64 │
├──────────────┤
│ 192497 │
└──────────────┘
```

If I run the following statement via JDBC, my computer freezes hard. I can't even get to the terminal or login via SSH:
```sql
SELECT numtickets
, priceperticket
, totalprice
, listtime
FROM sales
, listing
-- LIMIT 10
;
```

Activating the `LIMIT 10` of course remedies the situation.

Now I wonder: Why would it freeze like that instead of obeying the available memory and/or why would the JDBC call not set a safety DuckDB memory limit (e.g. based on -Xmx as a good benchmark figure)?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.