HNHacker News
TopNewBestAskShowJobs

1egg0myegg0

170 karma · joined October 15, 2021

submissionscomments
1egg0myegg0··on Notes on the SQLite DuckDB Paper
It's likely out of memory issues with many many distinct values in an aggregated column, or with a very large join intermediate. The joins are now able to handle larger than RAM, and larger than RAM intermediates in a group by is on the roadmap!
1egg0myegg0··on Notes on the SQLite DuckDB Paper
Hmm, I would recommend reading a sample of the code first!
1egg0myegg0··on Can a Proof-of-Work chain use its computing toward real needs?
Short answer, no. Long answer, also no. Blockchain is inherently an inefficient way to compute. You should just trust a centralized authority and get waaaaay more utility for your compute. Your centralized authority could be the very cause or organization that you are computing for. If you trust them enough to run a random algorithm for them, you don't need a blockchain. You need to trust them as a central authority.
1egg0myegg0··on Show HN: Easily Convert WARC (Web Archive) into Parquet, Then Query with DuckDB
Good question! As a disclaimer, I work for DuckDB Labs.

There are 2 big benefits to working with Parquet files in DuckDB, and both relate to speed!

DuckDB can query parquet right where it sits, so there is no need to insert it into the db first. This is typically much faster. Also, DuckDB's engine is columnar (SQLite is row based), so it can do faster analytical queries using that format. I have seen 20-100x speed improvements over SQLite in analytical workloads.

Happy to answer any questions!

1egg0myegg0··on Range joins in DuckDB
We have a node client if that would be helpful! https://duckdb.org/docs/api/nodejs
1egg0myegg0··on Friendlier SQL with DuckDB
Interesting thought! I have not tried this yet so I only have a guess as an answer. Could you export the data as SQL statements and then run those statements on DuckDB? That may be easier to set up, but may take longer to run...

DuckDB also has the ability to read Postgres data directly, and there is a Postgres FDW that can read from DuckDB!

https://github.com/duckdblabs/postgresscanner

https://github.com/alitrack/duckdb_fdw

1egg0myegg0··on Friendlier SQL with DuckDB
For compatibility, the original column in the data source takes precedence. That's how other DBs handle things so we wanted to stay standard where it made sense!
1egg0myegg0··on Friendlier SQL with DuckDB
If you'd like to work with DuckDB in a SQL IDE/GUI, we recommend DBeaver! It uses the DuckDB JDBC connector. A quick how to guide is here: https://duckdb.org/docs/guides/sql_editors/dbeaver
1egg0myegg0··on Friendlier SQL with DuckDB
Good catch! Fixed! Needed a group by all in there.
1egg0myegg0··on Friendlier SQL with DuckDB
It is a goal of ours to become a standard multi-table storage format! However, today we are still in beta and have made some breaking changes in the last few releases. (Exporting from the old version, then reimporting your DB in the new allows you to upgrade!) Those should happen less often as we move forward (the storage format was genericized a bit and is more resilient to future enhancements now), and locking in our format amd guaranteeing backwards compatibility will occur when we go to 1.0!
1egg0myegg0··on Friendlier SQL with DuckDB
I should add that we can read/write Apache Arrow as well!
1egg0myegg0··on Friendlier SQL with DuckDB
Here is a solved Github Issue related to CGO for the Go bindings! If you have another issue, please feel free to post it on their Github page!

https://github.com/marcboeker/go-duckdb/issues/4

1egg0myegg0··on Friendlier SQL with DuckDB
Thanks! Can you tell that my SQL-fu is stronger than my HTML-fu? :-) Much appreciated!
1egg0myegg0··on Friendlier SQL with DuckDB
Ah, well, that was a risk that I took... Thank you for the feedback though! The Star Wars puns were too hard to resist...

If you have a specific question, definitely post it here and I will clarify!

1egg0myegg0··on Friendlier SQL with DuckDB
Yes, that benchmark result is quite old in Duck years! :-)

We actually run that benchmark as a part of our test suite now, so I am certain that there is improvement from that version.

The biggest DuckDB I've used so far was about 400 GB on a machine with ~250 GB of RAM.

There is ongoing work that we are treating as a high priority for handling larger-than-memory intermediate results within a query. But we can handle larger than RAM in many cases already - we sometimes run into issues today if you are joining 2 larger than RAM tables together (depending on the join), or if you are aggregating a larger than RAM table with really high cardinality in one of the columns you are grouping on.

Would you be open to testing out your use case and letting us know how it goes? We always appreciate more test cases!

1egg0myegg0··on Friendlier SQL with DuckDB
Fugue has a DuckDB back end and I believe they can actually use Dask and DuckDB in combination for what I believe is similar to what you are looking for! There is also a way to map Python functions in DuckDB using the relational (dataframe-like) API.

https://fugue-tutorials.readthedocs.io/tutorials/integration...

https://github.com/duckdb/duckdb/pull/1569

1egg0myegg0··on Friendlier SQL with DuckDB
Here is a paper that was used when building the DuckDB approach!

https://db.in.tum.de/~leis/papers/ART.pdf

There are some other papers and details about the architecture here: https://duckdb.org/why_duckdb

1egg0myegg0··on Friendlier SQL with DuckDB
Good questions! You are correct that it depends. We do have indexes to help with point queries, but they are not going to be quite as fast as SQLite because DuckDB stores data in a columnar format. (Soon they will be persistent - see comments above!) That columnar format is really great for scanning many items, but not optimal for grabbing all of a single row.

With DuckDB, bulk inserts are your friend and are actually super fast.

Definitely let us know what you find! Just open up a discussion on Github if you'd like to share what you find out: https://github.com/duckdb/duckdb/discussions

1egg0myegg0··on Friendlier SQL with DuckDB
Let me see if I can assuage some of your concerns!

First off - DuckDB is MIT licensed, so you are welcome to use and enhance it essentially however you please!

DuckDB Labs is a commercial entity that offers commercial support and custom integrations. (https://duckdblabs.com/). If the MIT DuckDB works for what you need, then you are all set no matter what!

However, much of the IP for DuckDB is owned by a foundation, so it is independent of that commercial entity. (https://duckdb.org/foundation/)

Does that help? Happy to answer any other questions!

1egg0myegg0··on Friendlier SQL with DuckDB
Yes, it is always difficult to use dates in SQLite... DuckDB makes dates easier - like they should be!
1egg0myegg0··on Friendlier SQL with DuckDB
Yes, good thought! That is listed at the bottom of the article as something we are looking at for the future.
1egg0myegg0··on Friendlier SQL with DuckDB
Persistent indexes are being actively worked on! Stay tuned. As for the crashes - DuckDB is very well tested and used in production in many places. The core functionality is very mature! Let us know if you test it out! Happy to help if I can.

(disclaimer - on the DuckDB team)

1egg0myegg0··on Friendlier SQL with DuckDB
Excellent question! I'll jump in - I am a part of the DuckDB team though, so if other users have thoughts it would be great to get other perspectives as well.

First things first - we really like quite a lot about the SQLite approach. DuckDB is similarly easy to install and is built without dependencies, just like SQLite. It also runs in the same process as your application just like SQLite does. SQLite is excellent as a transactional database - lots of very specific inserts, updates, and deletes (called OLTP workloads). DuckDB can also read directly out of SQLite files as well, so you can mix and match them! (https://github.com/duckdblabs/sqlitescanner)

DuckDB is much faster than SQLite when doing analytical queries (OLAP) like when calculating summaries or trends over time, or joining large tables together. It can use all of your CPU cores for sometimes ~100x speedup over SQLite.

DuckDB also has some enhancements with respect to data transfer in and out of it. It can natively read Pandas, R, and Julia dataframes, and can read parquet files directly also (meaning without inserting first!).

Does that help? Happy to add more details!

1egg0myegg0··on Friendlier SQL with DuckDB
Thank you for the feedback! I will check those Clickhouse features out. I totally agree on the trailing commas, and I use commas first syntax for that same reason! But maybe not anymore... :-)
1egg0myegg0··on D1: Our SQL database
Close! DuckDB has very fast bulk insert speeds, but slower individual row insertion/update speeds. (Disclaimer: I write docs for DuckDB)
1egg0myegg0··on Ask HN: Can you program without an Internet connection?
Can it be done? Yes. Can I do it? No. Would I want to? Also no.
1egg0myegg0··on Fast analysis with DuckDB and Pyarrow
I hope that DuckDB can help here! You can use the CLI or Python client to read a parquet file, but my favorite for quick exploration is popping open DBeaver (a SQL IDE) and using the DuckDB JDBC driver. That way you can see some column metadata, and even open multiple files, etc. I wrote a short guide for that here: https://duckdb.org/docs/guides/sql_editors/dbeaver
1egg0myegg0··on Fast analysis with DuckDB and Pyarrow
We have a Relational API in addition to SQL! Here are some examples for the Python Relational API client:

https://github.com/duckdb/duckdb/blob/master/examples/python...

Plus, if you are working in Python, you can use DuckDB as the engine underneath Ibis, Fugue, Siuba, or anything that works with SQLAlchemy (using the DuckDB-engine driver)! In R, you can use dplyr or dbplyr.

DuckDB's file format is one way to persist data (it uses a single file), but you can also write out to Parquet, or write out to Apache Arrow and then parquet (in a partitioned format I believe).

Disclaimer - I write docs for DuckDB!

1egg0myegg0··on Fast analysis with DuckDB and Pyarrow
DuckDB is not only an in memory DB - it can persist data and handle larger than RAM workloads. We are expanding the number of operators that can handle larger than memory data, but it is a key design goal!
1egg0myegg0··on Fast analysis with DuckDB and Pyarrow
DuckDB can certainly handle larger than memory data! It's a streaming engine, so it doesn't need everything in memory all at once. Some operators (like sorting) can also buffer out to disk if you run low on memory mid-computation. We are working to expand that to more operators! It also can selectively read from parquet for only the columns and row groups that you need. (Disclaimer - I do documentation for DuckDB!)
← PreviousPage 2 of 3Next →