When we need to use 1-to-1 relationship in database design?

后端 未结 4 726
眼角桃花
眼角桃花 2020-12-02 00:45

When do we need to use a 1-to-1 relationship in database design? In my opinion, if two tables are in a 1-to-1 relationship, they can be combined into one table. Is this true

4条回答
  •  醉梦人生
    2020-12-02 00:53

    1. Vertical partitioning for large tables to reduce I/O and cache requirements -- separate columns that are queried often vs rarely.

    2. Adding a column to a production system when the alter table is "too expensive".

    3. Super-type/subtype pattern.

    4. Vertical partitioning to benefit from table (join) elimination -- providing optimizer supports it (again to reduce I/O and cache) .

    5. Anchor modeling -- similar to 4, but down to 6NF.

提交回复
热议问题