|
|
关于业务主键 Vs. 逻辑主键 该用谁 的讨论,整理一下.
大家不认为逻辑主键有什么缺点吗?都用它吗? 以下是我的引述:
--
1.They're not standard SQL. Most products have it but there's no consistent implementation.
2.They can't be updated. This violates the relational data model (not fatal, but not good either). Duplicates can be accidentally inserted (fatal).
3.They only create numeric values. GUID/NewID() are also numeric only, and are hard to read.
4.Numeric values are not meaningful in many tables, and adding them complicates relationships between other tables.
--
Problems such as supporting replication, merging, and a providing a limited number of unique values for a heavy transactional systems
--
SEQUENCE字段不要作为表的主键与其它表关联,这将会影响到该表的数据迁移。
--
欢迎讨论. |
|