4 ms·
DuckDB 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.o
by szarnyasg 3y ago
DuckDB 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...