4
1.
2.
-, , , , .
, . , ( , , ..) . , , - . , . .
(data mart) , . , . : ; , , ; ; .
. , , ( , ). , , , , , . -, , -, . . . - , . .
|
|
, (, , , ) ( , , ) . , . . .
, . , , (. 1).
1
, . 1.
1
: SQL , .
, , (. 3).
2
. , . , , . , . , SQL-:
select sum(fact_table.cost)
from fact_table, dimension_table D1, dimension_table D2
where fact_table.dimension_id = D2.id
and D2.left >= D1.left
and D2.right <= D1.right
and D1.name =
left, right : Level , Is_leaf , . , dimension_table ( 2), .
2
, , (helper-table), . : -, . 3.
|
|
3
(. 4) , , , . , Distance Is Leaf, .
4
, , , , , SQL-:
select sum(fact_table.cost)
from fact_table, dimension_table, helper_table
where fact_table.dimension_id = helper_table.child_id
and dimension_table.dimension_id = helper_table.parent_id
and dimension_table.name =
and helper_table.distance = 1
.
, , . . . , , . , .
, -. , , - . , , , .. , . , , ; , , . , , . , .