Star schema, normalized dimensions, denormalized hierarchy level keys

前端 未结 2 1844
遥遥无期
遥遥无期 2020-12-14 22:27

Given the following star schema tables.

  • fact, two dimensions, two measures.

#   geog_abb  time_date amount     value
#1:                


        
2条回答
  •  旧时难觅i
    2020-12-14 23:02

    You are building a snowflake schema with shortcuts.

    It's used and BI tools can easily use the shortcuts.

    You can also have shortcuts from a parent level of a dimension to a fact table at child level for that dimension. It works, you can skip a join, but you need to store an additional column in the fact table.

    The only concern is about data integrity, if a parent-child relationship changes you need to update not only the child table, but also all other tables where this relationship is stored.

    It's not a big deal if you generate every time your dimension table from your normalize data, but you need to be careful, even more if you store a parent ID in the fact table.

提交回复
热议问题