Database Reference
In-Depth Information
a
b
Product
Key
Product
Name
...
Discontinued
...
Yes No
p1
prod1
...
No
...
0
1
p2
prod2
...
Yes
...
1
0
p3
prod3
...
No
...
0
1
p4
prod4
...
Yes
...
1
0
p5
prod5
...
No
...
0
1
p6
prod6
...
Yes
...
1
0
c
Customer
Key
Customer
Name
Postal
Code
Address
...
c1
cust1
35 Main St.
7373
...
c2
cust2
Av. Roosevelt 50 1050
...
c3
cust3
Av. Louise 233
1080
...
c4
cust4
Rue Gabrielle
1180
...
d
e
f
g
Product
Key
Customer
Key
Time
Key
Sales
Amount
c1 c2 c3 c4
p1 p2 p3 p4 p5 p6
Yes No
p1
c1
t1
100
1
0
0
0
1
0
0
0
0
0
0
1
p1
c2
t1
100
0
1
0
0
1
0
0
0
0
0
0
1
p2
c2
t2
100
0
1
0
0
0
1
0
0
0
0
1
0
p2
c2
t3
100
0
1
0
0
0
1
0
0
0
0
1
0
p3
c3
t3
100
0
0
1
0
0
0
1
0
0
0
0
1
p4
c3
t4
100
0
0
1
0
0
0
0
1
0
0
1
0
p5
c4
t5
100
0
0
0
1
0
0
0
0
1
0
0
1
Fig. 7.13
An example of evaluation of star queries with bitmap indexes. (
a
)
Product
table. (
b
)Bitmapfor
Discontinued
.(
c
)
Customer
table. (
d
)
Sales
fact table. (
e
)Bitmap
for
CustomerKey
.(
f
)Bitmapfor
ProductKey
.(
g
)Bitmapjoinindexfor
Discontinued
We will study now how this query is evaluated by an engine using the indexing
strategies studied above.
An ecient evaluation of our example query would require the definition of
aB
+
-tree over the dimension keys
CustomerKey
and
ProductKey
and bitmap
indexes on
Discontinued
in the
Product
dimension table and on the foreign
key columns in the fact table
Sales
. Figure
7.13
a,c,d shows the
Product
and
Customer
dimension tables and the
Sales
fact table, while the bitmap indexes
are depicted in Fig.
7.13
b,e,f.
Let us describe how this query is evaluated by an OLAP engine. The
first step consists in obtaining the record numbers of the records that satisfy
the condition over the dimension, that is,
Discontinued
= '
Yes
'.Asshownin
the bitmap index (Fig.
7.13
b), such records are the ones with
ProductKey
Search WWH ::
Custom Search