3 ms·
Primary keys in ClickHouse are not unique
- PaulHoule 3y agoMakes me glad I never had anything to do with ClickHouse.
- andreareina 3y agoIIRC Amazon Redshift doesn't enforce unique constraints either
- hodgesrm 3y agoReferential integrity is not a big problem in analytic databases. Finding things is. ClickHouse uses primary key indexes to locate blocks of rows quickly in very large tables. The indexes are sparse and by default only have 1 entry for every 8192 rows. The organization allows the index to fit in RAM even when the table is very large. This is a common design choice in analytic systems.
- PeterZaitsev 3y agoClickhouse used to refer to it as "Clustered Key"... in reality though when you load your data it makes sense to take on primary key definition and handle it as primary key in many workloads. Yet I wish Clickhouse would allow the mode to ensure Uniqueness of Primary key, so people can see it consts so much in Performance, you better to ensure uniqueness is checked elsewhere :)