




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 1
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 2
Ā Contrast such On-Line Analytic Processing (OLAP) with traditional On-line Transaction Processing (OLTP): mostly long queries, instead of short update Xacts.
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 3
Ā Loading, periodic synchronization of replicas. Ā Semantic integration.
Ā Complex SQL queries and views. Ā Queries based on spreadsheet-style operations and āmultidimensionalā view of data. Ā Interactive and āonlineā queries.
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 4
EXTERNAL DATA SOURCES
EXTRACT TRANSFORM LOAD REFRESH
DATA Metadata WAREHOUSE Repository
SUPPORTS
DATA MINING
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 5
Ā Replication capabilities can be exploited here.
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 6
Ā E.g., measure Sales , dimensions Product (key: pid), Location (locid), and Time (timeid).
timeid
pid 11
pidtimeidlocidsales
locid
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 10
Ā E.g., Given total sales by state, can drill-down to get total sales by city. Ā E.g., Can also drill-down on different dimension to get total sales by product for each state.
Ā E.g., Pivoting on Location and Time yields this cross-tabulation : (^) 63 81 144
38 107 145
75 35 110
WI CA Total 1995 1996
1997
Total176 223 339
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 11
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 12
Ā Equivalent to rolling up Sales on all eight subsets of the set {pid, locid, timeid}; each roll-up corresponds to an SQL query of the form:
GROUP BY grouping-list
Lots of work on optimizing the CUBE operator!
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 13
Ā Dimension tables are small; updates/inserts/deletes are rare. So, anomalies less important than query performance.
pid pnamecategoryprice locid city state country
pidtimeidlocidsales
timeid dateweekmonth quarter yearholiday_flag
SALES(Fact table)
TIMES
PRODUCTS LOCATIONS
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 14
Bit-vector:^ sex^ custid name sex rating^ rating 1 bit for each possible value. Many queries can be answered using bit-vector ops!
M F
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 15
Ā A join index can be constructed to speed up such joins. The index contains [s,p,t,l] if there are tuples (with sid) s in Sales, p in Products, t in Times and l in Locations that satisfy the join (and selection) conditions.
Ā A variation addresses this problem: For each column with an additional selection (e.g., country), build an index with [c,s] in it if a dimension table tuple with value c in the selection column joins with a Sales tuple with sid s; if indexes are bitmaps, called bitmapped join index.
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 19
Ā Idea: Guess at a cost c such that the 10 cheapest all cost less than c, and that not too many more cost less. Then add the selection cost<c and evaluate the query.
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 20
SELECT P.pid, P.pname, S.sales FROM Sales S, Products P WHERE S.pid=P.pid AND S.locid=1 AND S.timeid= ORDER BY S.sales DESC OPTIMIZE FOR 10 ROWS
Ā OPTIMIZE FOR construct is not in SQL:1999! Ā Cut-off value c is chosen by optimizer.
SELECT P.pid, P.pname, S.sales FROM Sales S, Products P WHERE S.pid=P.pid AND S.locid=1 AND S.timeid= AND S.sales > c ORDER BY S.sales DESC
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 21
Ā Can show the current ārunning averageā for each state as the computation proceeds. Ā Even better, if we use statistical techniques and sample tuples to aggregate instead of simply scanning the aggregated table, we can provide bounds such as āthe average for Wisconsin is 2000±102 with 95% probability.
Database Management Systems, 2 nd^ Edition. R. Ramakrishnan and J. Gehrke 22