3 ms·
I've never heard of DuckDB. I haven't used SQLite a lot, but one thing that I noticed it lacks, and this is pretty important, is that you can't add a foreign ke
by AlienRobot 3y ago
I've never heard of DuckDB. I haven't used SQLite a lot, but one thing that I noticed it lacks, and this is pretty important, is that you can't add a foreign key constraint after a table is created, which is bad if you change your schema later. I don't even understand why this limitation exists.
- szarnyasg 3y agoDuckDB also does not (yet) support adding foreign keys to a table, see: https://duckdb.org/docs/sql/statements/alter_table#add--drop-constraint https://duckdb.org/docs/sql/statements/alter_table#add--drop... One typical way to work around this limitation is to create a new table, copy the data there, and drop the old table. Copying from table to table is in general very fast. (Disclaimer: I work at DuckDB Labs)
- AlienRobot 3y agoThat's weird. I thought you would have to have FKs to be a RDBMS, otherwise there isn't much R-MS in it.
- szarnyasg 3y agoPrimary keys and foreign keys are rarely used in data science workloads. In our performance guide, we recommend users to avoid using primary keys unless they are absolutely necessary [1]. In workloads running in infrastructure components, keys and constraints are more important, and they are supported by DuckDB (but currently some of them can only be added when the table is created). [1] https://duckdb.org/docs/guides/performance/schema#microbenchmark-the-effect-of-primary-keys https://duckdb.org/docs/guides/performance/schema#microbench...