简体   繁体   中英

Fact table design with measures that occur in multiple fact tables

I'm working on a star-schema and trying to find a best practise for the database design.

I have three (at this moment) dimension tables for several facts. Most of the facts look-a-like (meaning they're a different type of fact, but share characteristics). While the shared measures don't belong in the dimension tables (since they're not facts, but results to a logical test/condition at a specific moment) I'm wondering what the best practise is for this situation.

  1. Do all the fact tables have the 'shared' measures
  2. Would/could some sort of fact snow-flake fact structure arise (with the query performance issues it will bring)

Looking forward to your insights and argumentation on the subject.

A bit too vague, but here are a few options:

1) if all facts have the same granularity and measures, consider keeping them all in the same fact table, together with a fact type dimension;

2) Join the various fact tables via virtual cubes. Most OLAP tools should allow for such a construction (eg, Mondrian does)

3) If the various fact tables have the same granularity but different measures then they can still be combined, but having each type of fact contribute with a different set of fact table columns (instead of just rows)

4) If neither of the above is possible (different granularities, for example), you may need to re-combine them at the coarser grain level (with aggregation) or at the finer grain level (with some allocation algorithm), to analyze them together.

5) If this is still not possible, you may want to combine not the fact tables themselves, but the query results at the report/dashboard level, combining just the aggregated results instead of the atomic database rows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM