Presentation is loading. Please wait.

Presentation is loading. Please wait.

Query Optimization For OLAP-XML Federations Dennis Pedersen Karsten Riiis Torben Bach Pedersen Nykredit Center for Database Research Department of Computer.

Similar presentations


Presentation on theme: "Query Optimization For OLAP-XML Federations Dennis Pedersen Karsten Riiis Torben Bach Pedersen Nykredit Center for Database Research Department of Computer."— Presentation transcript:

1 Query Optimization For OLAP-XML Federations Dennis Pedersen Karsten Riiis Torben Bach Pedersen Nykredit Center for Database Research Department of Computer Science, Aalborg University www.cs.auc.dk/NDB

2 DOLAP 2002 Workshop# 2 November 8, 2002 Overview Motivation OLAP-XML federations Federation system Inlining Optimizing XML retrieval Caching and prefetching Experimental results Related work Conclusion and future work

3 DOLAP 2002 Workshop# 3 November 8, 2002 Motivation OLAP-systems are good for complex analysis queries Easy-to-use Fast Business, science... More and more data is needed for the analyses Problems with physical integration in existing OLAP systems Integrating new data requires (partial) cube rebuild => too slow Problems arise with Short term and varying data needs  Demographic info, disease info... Dynamic data  Stock quotes, competitors prices, disease info... Data with limited access  Product information, public databases, scientific data banks

4 DOLAP 2002 Workshop# 4 November 8, 2002 Motivation Data will often (in the future) be available in XML format Info syndicators, public institutions,… Scientific sources: SWISS-PROT, TrEMBL, GenBank,… Goal: flexible access to XML data from OLAP systems Aalborg 160.000 University Town Sonofon Nokia … Hierarchical Elements Start-tag, end-tag Describes the semantics of the data Irregular structure

5 DOLAP 2002 Workshop# 5 November 8, 2002 OLAP-XML Federation Using of external XML data as virtual dimensions δ: decoration (add extra dimension) π: generalized projection (grouping) σ: selection Loosely-coupled federation Data stored in the ”best” place Supports ad-hoc integration Rapid prototyping of DWs High degree of autonomy Data is always up-to-date Performance problem? SQL XM language SELECT City[ALL]/Category, SUM(Price) FROM Sales GROUP BY City[ALL]/Category WHERE City[ALL]/Population>200,000

6 DOLAP 2002 Workshop# 6 November 8, 2002 OLAP-XML Federation Aalborg 160,000 University Town Sonofon Nokia Time T Year Quarter Month Products T Family Brand Product Stores T Country City Store Amount, Price

7 DOLAP 2002 Workshop# 7 November 8, 2002 OLAP-XML Federation Aalborg 160,000 University Town Sonofon Nokia Time T Year Quarter Month Products T Family Brand Product Stores T Country City Store Amount, Price Link

8 DOLAP 2002 Workshop# 8 November 8, 2002 Prototype Architecture SQL XM queries handled by Federation Manager (FM) XML Data stored in XML Component (Tamino) OLAP data stored in OLAP Component (MS Analysis) Link, Temp, and Meta-data stored in RDBMS FM fetches relevant data from components and processes SQL XM queries using Temp data

9 DOLAP 2002 Workshop# 9 November 8, 2002 Query Processing and Optimization Naive strategy Fetch necessary XML data and store in Temp DB Fetch necessary OLAP data and store in Temp DB Join XML and OLAP data + perform XML-specific part of SQL XM query Problem: too much data transferred to Temp DB Rule-based optimization Based on algebraic transformation rules Partition query tree into OLAP part, XML part, and Temp part Push as much evaluation to components as possible (always valid) Cost-based optimization Inline literal XML data values in OLAP queries Efficient fetch of XML data over XPath interfaces Caching/Prefetching in this particular setting Focus of this paper

10 DOLAP 2002 Workshop# 10 November 8, 2002 Overview Motivation OLAP-XML federations Federation system Inlining Optimizing XML retrieval Caching and prefetching Experimental results Related work Conclusion and future work

11 DOLAP 2002 Workshop# 11 November 8, 2002 Inlining Problem: decorations used for selections are expensive A lot of low-level OLAP data must be transferred to Temp Solution: inlining Get level expression predicate data from XML component Transform predicate to refer to literal data values Allows selection+aggregation to take place in OLAP component Predicate length will be linear/quadratic in no of dim values Queries may get too long Split into partial queries Inlining is particularly effective for OLAP systems Allows more aggregation in OLAP component

12 DOLAP 2002 Workshop# 12 November 8, 2002 Inlining Problem: what predicates to inline? Exponential number of possibilities Theorem: choosing the best inlining strategy is NP-hard No obvious best choice Often, an exhaustive search is feasible Otherwise, two heuristics are used Top down (see right above) Start from no inlining and add Will often fail Bottom up Start with all inlined and remove Less likely to fail General strategy Generate all bottom up, except if cost goes up very much

13 DOLAP 2002 Workshop# 13 November 8, 2002 Optimizing XML Retrieval XML component queries retrieve (locator,level exp) tables Example tuple: (Aalborg, 160,000) Easy to do in XQuery, but not in XPath XPath can fetch only entire existing nodes Many systems provide only an XPath interface One query for every dimension value? Often too much overhead because of many queries Combining with OR/IN not possible as XPath result is unordered Common parent of locator and level exp can be fetched Larger data volume may have to be returned Data for several level exps may be fetched together by combining XPath expressions Algorithm for doing this in full paper Cost analysis chooses between these options

14 DOLAP 2002 Workshop# 14 November 8, 2002 Caching and pre-fetching General technique specialized for this particular domain Caching/prefetching not feasible for very dynamic data Given a new query tree the cache is checked Identical query tree found: use cache (always fastest) Lower part of query tree found: compare cost of using cache to not using it (not using cache may be faster due to OLAP pre-aggregation) Caching and prefetching is done for component queries only Entire federation queries take up too much space and has too little probability of reuse XML cache Raw XML data + temporary XML mapping tables OLAP cache Intermediate OLAP result tables LRU cache replacement strategy used

15 DOLAP 2002 Workshop# 15 November 8, 2002 Cost Model Federation cost model Parallel exec of queries 1-4 OLAP waits for 3+4 (inlined) OLAP query not split Results combined in Temp OLAP cost model Cost OLAP = t OLAPOH + t OLAPEval + t OLAPTrans Based on network+disk rate, selectivity, fact size, rollup fraction, cube size, and possibilities for using pre-aggregation XML cost model Based on assumption of constant data rate from a given document Cost XML = t XMLOH + t XMLProc Temp component used standard relational cost model All models adapt based on real execution times Details + parameter estimation in another paper XML 1 XML 2 XML 3 XML 4 OLAP TEMP Time

16 DOLAP 2002 Workshop# 16 November 8, 2002 Experiments Test data 50 MB TPC-H OLAP, 10MB preagg, 10 MB cache, 3 MB XML, Behavior of different query types Decoration, grouping, selection Temp time generally short compared to OLAP and XML time OLAP time generally highest Inlining Compared three cases (no, simple, and cost-based inlining) Simple inlining 5 times faster than no inlining Cost-based inlining  3 times faster than simple inlining  15 times faster than no inlining Caching/prefetching Remote data versus all data stored locally Local evaluation 4-25 times faster than remote

17 DOLAP 2002 Workshop# 17 November 8, 2002 Experiments Another experiment compared: Our solution (flexibility optimal) Physical integration (performance optimal) Data 1GB fact data based on TPC-H 10MB XML data 100 MB pre-aggregated data Decoration, grouping, selection queries All optimizations used For ”typical” queries The overhead of our solution was only 25-50% Some queries will perform badly

18 DOLAP 2002 Workshop# 18 November 8, 2002 Related Work Generic data integration Relational, XML, semi-structured, OO,… + combinations Do not consider OLAP DB properties such as automatic aggregation, dimension hierarchies and correct aggregation Query processing and optimization for: Data warehousing/OLAP Federated, distributed, and multi-databases Heterogeneous data XML and semi-structured data Does not address the special case of a federated OLAP environment OLAP-object federations (own work) Simple form of inlining Does not consider cost-based optimization

19 DOLAP 2002 Workshop# 19 November 8, 2002 Conclusion and Future Work OLAP handles schema changes and dynamic data poorly Solution OLAP-XML federations Cost-based optimization needed Three techniques presented Inlining Optimized XML retrieval Caching and prefetching Made OLAP-XML federation perform very well Technology being implemented by OLAP query tool vendor Future work Further experimentation Capturing document order Getting measures from XML data


Download ppt "Query Optimization For OLAP-XML Federations Dennis Pedersen Karsten Riiis Torben Bach Pedersen Nykredit Center for Database Research Department of Computer."

Similar presentations


Ads by Google