Earlier quoted context omitted.
Databases are just much, much faster than Pandas, and that's before you start factoring the extraction and loading of data. I treat Pandas as a last resort when I can't do something in SQL, generally this is something like integrating with external services or running recordlinkage.
If you're curious, I've written a FOSS record linkage library that executes everything as SQL. It supports multiple SQL backends including DuckDB and Spark for scale, and runs faster than most competitors because it's able to leverage the speed of these backends: https://github.com/moj-analytical-services/splink
DuckDB – An in-process SQL OLAP database management system
91–100 of 104 posts
Re: DuckDB – An in-process SQL OLAP database management system
#92I don't get this: * When to not use DuckDB: Multiple concurrent processes reading from a single writable database* So no concurrent reads? Or is it no concurrent reads while writing?
the latter - you can either have multiple concurrent readers or a single writer. see https://duckdb.org/faq.html#how-does-duckdb-handle-concurren... .
Re: DuckDB – An in-process SQL OLAP database management system
#93DuckDB is terrific. I'm bullish on its potential for simplifying many big data pipelines. Particularly, it's plausible that DuckDB + Parquet could be used on a large SMP machine (32+ cores and 128GB+ memory) to deal with data munging for 100s of gigabytes to several terabytes, all from SQL, without dealing with Hadoop, Spark, Ray, etc. I have successfully used DuckDB like above for preparing an ML dataset from about…
Re: DuckDB – An in-process SQL OLAP database management system
#94Anyone both tried duckdb and clickhouse-local?
Here's clickhouse's SQL support: https://clickhouse.com/docs/en/sql-reference/
Compare this to DuckDB's (on the sidebar): https://duckdb.org/docs/sql/introduction
DuckDB's SQL coverage is much more complete and matches my experience with full blown databases like Postgres and Redshift.
As well, performance-wise DuckDB is currently still somewhat faster than clickhouse-local [1] but I would say this is a secondary consideration -- as long as either is "fast enough for your purposes" this shouldn't be an issue -- and clickhouse is plenty fast.
The primary consideration for me would be the SQL support. That said, if you don't use any complex SQL, clickhouse-local seems like it would be a worthy contender.
[1] https://benchmark.clickhouse.com/#eyJzeXN0ZW0iOnsiQXRoZW5hIC...
Re: DuckDB – An in-process SQL OLAP database management system
#95Its disappointing that C++ was chosen to build something that is going to live in-process. Rust would have been so much safer. All the segfaults you get when running DucDB supports this statement.
I agree about Rust's memory safety advantage over C++, but I disagree that it's disappointing from a project perspective. Some DB experts made a good DB using a performant language they're comfortable with. You can't make project choices in a vacuum, and you can't assume others can either. People have limited time. The choice they were facing was probably not C++ vs Rust, but C++ vs nothing because they didn't have t…
It can be done and it’s not that hard.
I think the choice of C++ for an in-process DB that is going to be very popular makes the entire industry less secure. If Chrome, one of the largest budget C++ code bases, still has memory bugs then there is no way DuckDB won’t.
Re: DuckDB – An in-process SQL OLAP database management system
#96DuckDB is terrific. I'm bullish on its potential for simplifying many big data pipelines. Particularly, it's plausible that DuckDB + Parquet could be used on a large SMP machine (32+ cores and 128GB+ memory) to deal with data munging for 100s of gigabytes to several terabytes, all from SQL, without dealing with Hadoop, Spark, Ray, etc. I have successfully used DuckDB like above for preparing an ML dataset from about…
I use Clickhouse to store close to 1TB of API analytics data (which would be 10TB in MongoDB, Clickhouse has insane compression ) and it's a wonderful and stable SQL-first alternative to DuckDB - which is a very exciting piece of software, but is indeed too young to embed into boring production. The last time I checked DuckDB npm package, it used callbacks instead of awaits..
Re: DuckDB – An in-process SQL OLAP database management system
#97DuckDB is terrific. I'm bullish on its potential for simplifying many big data pipelines. Particularly, it's plausible that DuckDB + Parquet could be used on a large SMP machine (32+ cores and 128GB+ memory) to deal with data munging for 100s of gigabytes to several terabytes, all from SQL, without dealing with Hadoop, Spark, Ray, etc. I have successfully used DuckDB like above for preparing an ML dataset from about…
Recently tried the GUI tool for ducks, forgot what's it called, something like 'Tab' and was quite disappointed. I feel duckdb needs a good tool like sqliteviewer to really take off.
Re: DuckDB – An in-process SQL OLAP database management system
#98Earlier quoted context omitted.
How would you do df.T in sql?
df.T is a special Pandas dataframe transpose on the dataframe index and the columns. DuckDB produces Pandas dataframes, so you would just do df.T. No need to choose between one the other. But to answer your original question, the SQL analogue to a transpose are PIVOT/UNPIVOT operations which are mathematically rotation operations on invariants (your dimensions). This makes them much more general than a transpose -- w…
Transforming into a pandas df isn't zero copy.
UNPIVOT and PIVOT are quite verbose compared to df.T.
Re: DuckDB – An in-process SQL OLAP database management system
#99DuckDB is terrific. I'm bullish on its potential for simplifying many big data pipelines. Particularly, it's plausible that DuckDB + Parquet could be used on a large SMP machine (32+ cores and 128GB+ memory) to deal with data munging for 100s of gigabytes to several terabytes, all from SQL, without dealing with Hadoop, Spark, Ray, etc. I have successfully used DuckDB like above for preparing an ML dataset from about…
As far as I can tell, DuckDB is an alternative to "data frame" libraries like Data.table, Polars, Pandas, etc. Is that the case? What makes DuckDB a better choice than, say, Polars?
For example, this is how some basic operations would look in pandas.
Bump prices in 2020 up $1:
prices_df.loc['2020'] += 1
Add expected temperature offsets to base temperature forecast: temp_df + offset_df
Now imagine thousands of such operations, and you can see the necessity of pandas in models like this.Re: DuckDB – An in-process SQL OLAP database management system
#100Earlier quoted context omitted.
As far as I can tell, DuckDB is an alternative to "data frame" libraries like Data.table, Polars, Pandas, etc. Is that the case? What makes DuckDB a better choice than, say, Polars?
SQL is easier and more natural to work with than Pandas.
In pandas it’s:
prices_df.loc['2020'] += 1
If you had a temperature forecast and you wanted to add the expected temperature miss to them, how would you do that on sql?In pandas it’s:
temps_df + expected_miss_df