Junk Dimensions
يعني إيه؟
Dimension متجمّع فيه شوية Attributes صغيرة وملهمش قيمة لوحدهم
بيكون إمتى؟
لما يبقى عندك:
-
Flags
-
Yes / No
-
Small Codes
-
Statuses
ومش عايز:
-
تحطهم في الـ Fact (هيبقى شكله وحش)
-
تعمل لكل واحد Dimension (overkill)
مثال
بدل ما تحط دول في Fact:
-
IsOnlineOrder
-
IsDiscounted
-
PaymentType
-
OrderPriority
بتعمل:
DimOrderFlags
| JunkKey | IsOnline | IsDiscounted | PaymentType | Priority |
|---|
وتحط JunkKey في Fact
- Combine low-cardinality attributes that don’t belong in existing dimensions into a junk dimension
- Avoids creating many small dimension tables; for the purpose of simplifying the model.
Degenerate Dimension
- A key without its related dimension
- Provides grouping and business meaning (i.e: the college-department code in a university; this code is usually well known by the decision-makers or the business owners)
يعني إيه؟
لكن:
بيكون إمتى؟
مثال كلاسيك
➡️ يبقى Degenerate DimensionOrderDate ProductKey CustomerKey OrderNumber Amount
الخلاصةهو Attribute شكله Dimension
-
مالوش جدول Dimension لوحده
-
بيتخزن مباشرة في جدول الـ Fact
لما يكون عندك:
-
قيمة تعريفية / مرجعية
-
ملهاش Attributes تانية تتعمل Dimension كاملة
FactSales
🔹 OrderNumber
-
مهم للتحليل
-
لكن:
-
مالوش اسم
-
مالوش نوع
-
مالوش Hierarchy
-
-
Dimension منطقيًا
-
Fact تقنيًا
-
لا جدول لوحده
-


Comments
Post a Comment