One goofy SELECT can freeze the computer hard
- Vorherrschende Sprache
- C++
- Sterne
- 127
- Forks
- 80
- Ø Merge
- 13 Std. 49 Min.
- Gemergte PRs (30 T.)
- 48
Beschreibung
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)?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Es ist keine Quelldatei oder kein Test genannt. Beginne damit, den unbegrenzten Cross-Join über JDBC mit und ohne LIMIT 10 zu reproduzieren, und untersuche anschließend, wie der Treiber Speichergrenzen behandelt. Als erledigt sollte gelten, dass das Verhalten begrenzt ist oder sicher fehlschlägt, ohne den Host einzufrieren, und dass eine Regressionstestabdeckung für die gemeldete Abfrage vorhanden ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, sql
- Bereich
- databases
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100