duckdb / duckdb/duckdb-java

One goofy SELECT can freeze the computer hard

Aperta
#29 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
127
Fork
80
Merge medio
13h 49m
PR unite (30g)
48

Descrizione

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)?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Non è indicato alcun file sorgente né alcun test. Inizia riproducendo il cross join non limitato tramite JDBC, con e senza LIMIT 10, quindi esamina come il driver gestisce i limiti di memoria. Il lavoro dovrebbe considerarsi completato quando il comportamento è limitato oppure fallisce in modo sicuro senza bloccare l’host, con una copertura di regressione per la query segnalata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, sql
Ambito
databases
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.