資源描述:
《fact tables and dimension tables事實(shí)表和維度表》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫(kù)。
1、FactTablesandDimensionTablesThelogicalfoundationofdimensionalmodelingbyRalphKimballJanuary1,2003Dimensionalmodelingisadesigndisciplinethatstraddlestheformalrelationalmodelandtheengineeringrealitiesoftextandnumberdata.Comparedtoentity/relationmodeling,it'
2、slessrigorous(allowingthedesignermorediscretioninorganizingthetables)butmorepracticalbecauseitaccommodatesdatabasecomplexityandimprovesperformance.Contrastedwithothermodelingdisciplines,dimensionalmodelinghasdevelopedanextensiveportfoliooftechniquesforha
3、ndlingreal-worldsituations.MeasurementsandContextDimensionalmodelingbeginsbydividingtheworldintomeasurementsandcontext.Measurementsareusuallynumericandtakenrepeatedly.Numericmeasurementsarefacts.Factsarealwayssurroundedbymostlytextualcontextthat'strueatt
4、hemomentthefactisrecorded.Factsareveryspecific,well-definednumericattributes.Bycontrast,thecontextsurroundingthefactsisopen-endedandverbose.It'snotuncommonforthedesignertoaddcontexttoasetoffactspartwaythroughtheimplementation.Althoughyoucouldlumpallconte
5、xtintoawide,logicalrecordassociatedwitheachmeasuredfact,you'llusuallyfinditconvenientandintuitivetodividethecontextintoindependentlogicalclumps.Whenyourecordfacts—dollarsalesofagrocerystorepurchaseofanindividualproduct,forexample—younaturallydividethecon
6、textintoclumpsnamedProduct,Store,Time,Customer,Clerk,andseveralothers.Wecalltheselogicalclumpsdimensionsandassumeinformallythatthesedimensionsareindependent.Figure1showsthedimensionalmodelforatypicalgrocerystorefact.Intruth,dimensionsrarelyarecompletelyi
7、ndependentinastrongstatisticalsense.Inthegrocerystoreexample,CustomerandStoreclearlywillshowastatisticalcorrelation.Butit'susuallytherightdecisiontomodelCustomerandStoreasseparatedimensions.Asingle,combineddimensionwouldlikelybeunwieldywithtensofmillions
8、ofrows.AndtherecordofwhenagivencustomershoppedinagivenstorewouldbeexpressedmorenaturallyinafacttablethatalsoshowedtheTimedimension.Theassumptionofdimensionindependencewouldmeanthatallthedimensions,suchasProduct,Store,andCu