Notes on the SQLite DuckDB Paper
simonwillison.net
simonwillison.net
Academic papers aren't really designed for casual reading - I always find them to be a bit of a slog. It would be great if it was much more common for people to share their notes like this.
I'm going to try and remember to write more of these in the future.
I should add that I found this particular paper to be a whole lot more readable than most!
I enjoyed reading your notes and benefited immensely from them.
[1]: https://benchmark.clickhouse.com/#eyJzeXN0ZW0iOnsiQXRoZW5hIC...
I believe it’s on the DuckDB roadmap to get better at memory use but apart from that it’s very very good at what it does — ie complex analytical queries. It vectorizes ops so everything is fast and efficient.
Is there really a lot of demand of doing analytics on edge devices?
I see a windmill example in the introduction of a paper linked from the post above. Is that really a big thing in the windmill space? Are modern windmills needing to use embedded devices on them to perform real time analytics that would be enabled by OLAP engines and queries like that?
Are there other such cases that folks know where this would be very useful?
If SQLite had better performance for OLAP queries, there is no way I wouldn't explore it as an option for work because it's so darn easy to use. The operational or hosting or cloud costs of other OLAP database is insanely high in comparison.
P.S. It's my personal opinion and experience that most companies have only about 1TB or less of analytics data. Large OLAP databases are just a waste for such small data but currently apart from DuckDB there aren't any cheap competitors for these small use cases. Postgres and SQLite are too slow (without some additional engineering).
It would be really neat if SQLite or DuckDB implemented a way to create (register) read-only external tables (like Apache Iceberg). That way your large OLAP database (Snowflake, etc) could manage (DDL & CRUD) the external table, while SQLite and DuckDB would consume from it and automatically get all of the updates/deltas to the external table.
clicks --> Iceberg
bits --> Snowflake/MPP <--> table --> DuckDB
pieces --> on S3
Snowflake could take care of all the analytical heavy lifting continually preparing/updating/unloading data to the Iceberg table in an analytics ready/friendly form (lags, leads, etc built into data).DuckDB could watch for changes on the Iceberg table (manifest) and update its internal representation of the external table as it changes. DuckDB can already read parquet files out on S3 so it should be somewhat trivial to implement? DuckDB could then handle all of the lightweight slicing/dicing of the analytics data; projections, counts, pagination, etc
Here's an example of Snowflake managing an Iceberg table: https://www.youtube.com/watch?v=Kz5cWY_vRwU
Also, with Pyarrow's help, DuckDB can already do this with Delta tables!
I've also been following DuckDB for a while and remain very excited about it. I've only recently become aware of DataFusion and am building a small project with it but I've not seen much discussion on it or any benchmark comparisons.
DataFusion seems to be part of the Apache Arrow stable and they've done a great service to analytics space, with DuckDB also being big supporters. I'm hoping this means that DataFusion has a good chance of also getting good traction and adding another option in this space.
Also Substrait for future backend independence.
https://twitter.com/andygrove_io/status/1559920848882073600?...
https://sqlite.org/2022/sqlite-tools-win32-x86-3390200.zip
Result: "1,108,480 sqlite3.exe". Then DuckDB:
https://github.com/duckdb/duckdb/releases/download/v0.4.0/du...
Result: "32,052,736 duckdb.exe" (already stripped)
To me, this says that SQLite is a carefully considered codebase, with great care put into making a lean and high quality piece of software. While DuckDB seems to have the hallmark of bloated C++ code, with plenty of waste, and little care to these details.