Escolar Documentos
Profissional Documentos
Cultura Documentos
FREIBURG I.BR.
HAMBURG
MNCHEN
STUTTGART
WIEN
Dani Schnider Principal Consultant and DWH/BI Lead Architect at Trivadis, Switzerland Teacher for courses about Data Warehousing, SQL Optimization and Oracle Warehouse Builder Co-author of book Data Warehousing mit Oracle
About Trivadis
Swiss IT Consulting Company
Main focus on databases
Vienna Freiburg Basel Bern Lausanne Munich
Hamburg
Dusseldorf
~180 employees
Frankfurt
Infrastructure Engineering Application Development Business Intelligence Managed Services Business Integration Services Training
Stuttgart
Zurich
~20 employees
More than 600 employees in 11 locations in Switzerland, Germany and Austria http://www.trivadis.com
~350 employees
SOME BITS ABOUT BITMAP INDEXES AND THEIR USAGE IN DATA WAREHOUSES
Bitmap indexes are primarily designed for data warehousing or environments in which queries reference many columns in an ad hoc fashion. Situations that may call for a bitmap index include: > The indexed columns have low cardinality, that is, the number of distinct values is small compared to the number of table rows. > The indexed table is either read-only or not subject to significant modification by DML statements.
Bitmap GENDER:
ROWID F M A 0 1 B 0 1 C 1 0 D 0 1 E 1 0 ...
Bitmap MARITALSTATUS:
ROWID D M S A 0 1 0 A 0 0 0 B 0 0 1 B 1 0 0 C 0 0 1 C 1 1 1 D 1 0 0 D 0 0 0 E 0 1 0 E 0 1 0 ... ...
CREATE BITMAP INDEX cust_marital_bix ON customers (maritalstatus) SELECT FROM WHERE AND firstname, lastname, gender, maritalstatus customers gender = 'F' maritalstatus = 'S'
-------------------------------------------------------------| Id | Operation | Name | -------------------------------------------------------------| 0 | SELECT STATEMENT | | | 1 | TABLE ACCESS BY INDEX ROWID | CUSTOMERS | | 2 | BITMAP CONVERSION TO ROWIDS| | | 3 | BITMAP AND | | |* 4 | BITMAP INDEX SINGLE VALUE| CUST_MARITAL_BIX | |* 5 | BITMAP INDEX SINGLE VALUE| CUST_GENDER_BIX | -------------------------------------------------------------7
2011 Trivadis
Data Warehousing & Bitmap Indexes
02.10.2011
B-tree Index
Bitmap Index
()1
()1
Why? Concatenated bitmap index can be used only when all columns are filtered Two or more separate bitmap indexes are more flexible and can be used for all combinations
10
Fact Tables:
Bitmap indexes on all dimension key (foreign key) columns
Bitmap join indexes on often used filter columns (optional)
Usually no primary key on fact tables
11
Dimension 1
Bitmap Index
DIM_1_ID
Bitmap Index
DIM_3_ID
Dimension 3
Fact Table
Dimension 2
2011 Trivadis
Data Warehousing & Bitmap Indexes
02.10.2011
Dimension 4
12
Problem:
Tables with restrictions should be read first
Only two tables can be joined at a time
No relationships between dimension tables
3 3
13
Products
AND
Customers
Bitmap Index SALES_CUST_BIX
14
2011 Trivadis
Data Warehousing & Bitmap Indexes
02.10.2011
15
17
21
100000
22
23
24
References
Oracle Database Data Warehousing Guide 11g Release 2 (11.2)
Oracle Corporation, http://www.oracle.com/pls/db112/
25
THANK YOU.
Trivadis AG Dani Schnider Europa-Strasse 5 CH-8152 Glattbrugg/Zrich Switzerland Tel. + 41 44 808 70 20 Fax + 41 44 808 70 21 info@trivadis.com www.trivadis.com
BASEL
BERN
LAUSANNE
ZRICH
DSSELDORF
FRANKFURT A.M.
FREIBURG I.BR.
HAMBURG
MNCHEN
STUTTGART
WIEN
26