RedShift 不允许键约束是否有特殊原因?请查看以下声明:
Uniqueness, primary key, and foreign key constraints are informational only; they are not enforced by Amazon Redshift. Nonetheless, primary keys and foreign keys are used as planning hints. and they should be declared if your ETL process or some other process in your application enforces their integrity.
这是由于速度还是其他什么原因?这其中一定有原因!
最佳答案
我认为主要原因是从数据加载性能的角度来看检查唯一性是不现实的。由于 Amazon Redshift 的架构旨在并行处理数据以进行横向扩展,因此加载的数据会分发到多个实例。因此,为了支持这些约束,它需要检查每行的实例之间的唯一性,由于 IO,这听起来非常慢。
关于sql - 为什么 RedShift 不允许键约束?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35758228/