Unique Contrains in Vertica DB

后端 未结 1 754
南笙
南笙 2021-01-26 22:18

Disclaimer: My DB knowledge comes mostly from Mysql so I might misunderstand some things in vertica...

I would like to know if there exist a technique of insert

相关标签:
1条回答
  • 2021-01-26 22:53

    Vertica does not enforce uniqueness of primary key or unique constraints on load due to the potential overhead associated with the operation.

    If ANALYZE_CONSTRAINTS() is run before committing, you should be able to capture potential duplicates. There's also overhead with doing UPDATEs and those should be avoided.

    There are ways to enforce uniqueness on load such as using MERGE, or staging the data in a temporary table. Each method has its own limitations. You can read more about enforcing uniqueness of data in my blog post.

    Update: As of 7.2, Vertica can automatically enforce primary and unique key constraints. See the documentation for more information.

    0 讨论(0)
提交回复
热议问题