1 Indexing and Querying XML Data for Regular Path Expressions A Paper by Quanzhong Li and Bongki Moon Presented by Amnon Shochot.

Slides:



Advertisements
Similar presentations
Bottom-up Evaluation of XPath Queries Stephanie H. Li Zhiping Zou.
Advertisements

Twig 2 Stack: Bottom-up Processing of Generalized-Tree-Pattern Queries over XML Documents Songting Chen, Hua-Gang Li *, Junichi Tatemura Wang-Pin Hsiung,
Efficient Keyword Search for Smallest LCAs in XML Database Yu Xu Department of Computer Science & Engineering University of California, San Diego Yannis.
Structural Joins: A Primitive for Efficient XML Query Pattern Matching Al Khalifa et al., ICDE 2002.
1 Abdeslame ALILAOUAR, Florence SEDES Fuzzy Querying of XML Documents The minimum spanning tree IRIT - CNRS IRIT : IRIT : Research Institute for Computer.
TREES Chapter 6. Trees - Introduction  All previous data organizations we've studied are linear—each element can have only one predecessor and successor.
Advanced Databases: Lecture 2 Query Optimization (I) 1 Query Optimization (introduction to query processing) Advanced Databases By Dr. Akhtar Ali.
1 CS 561 Presentation: Indexing and Querying XML Data for Regular Path Expressions A Paper by Quanzhong Li and Bongki Moon Presented by Ming Li.
QUANZHONG LI BONGKI MOON Indexing & Querying XML Data for../Regular Path Expressions/* SUNDAR SUPRIYA.
ViST: a dynamic index method for querying XML data by tree structures Authors: Haixun Wang, Sanghyun Park, Wei Fan, Philip Yu Presenter: Elena Zheleva,
Query Evaluation. An SQL query and its RA equiv. Employees (sin INT, ename VARCHAR(20), rating INT, age REAL) Maintenances (sin INT, planeId INT, day.
Trees Chapter 8.
Fall 2007CS 2251 Trees Chapter 8. Fall 2007CS 2252 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information.
1 Chapter 10 Query Processing: The Basics. 2 External Sorting Sorting is used in implementing many relational operations Problem: –Relations are typically.
Trees Chapter 8. Chapter 8: Trees2 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information To learn how.
1 CS 430: Information Discovery Lecture 4 Data Structures for Information Retrieval.
1 Lecture 20: Indexes Friday, February 25, Outline Representing data elements (12) Index structures (13.1, 13.2) B-trees (13.3)
Storing and Querying Ordered XML Using a Relational Database System By Khang Nguyen Based on the paper of Igor Tatarinov and Statis Viglas.
B + -Trees (Part 1). Motivation AVL tree with N nodes is an excellent data structure for searching, indexing, etc. –The Big-Oh analysis shows most operations.
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
1 Query Processing: The Basics Chapter Topics How does DBMS compute the result of a SQL queries? The most often executed operations: –Sort –Projection,
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
Binary Trees Chapter 6.
Xpath Query Evaluation. Goal Evaluating an Xpath query against a given document – To find all matches We will also consider the use of types Complexity.
Trees. Tree Terminology Chapter 8: Trees 2 A tree consists of a collection of elements or nodes, with each node linked to its successors The node at the.
A TREE BASED ALGEBRA FRAMEWORK FOR XML DATA SYSTEMS
XML as a Boxwood Data Structure Feng Zhou, John MacCormick, Lidong Zhou, Nick Murphy, Chandu Thekkath 8/20/04.
The main mathematical concepts that are used in this research are presented in this section. Definition 1: XML tree is composed of many subtrees of different.
CHAPTER 09 Compiled by: Dr. Mohammad Omar Alhawarat Sorting & Searching.
A Summary of XISS and Index Fabric Ho Wai Shing. Contents Definition of Terms XISS (Li and Moon, VLDB2001) Numbering Scheme Indices Stored Join Algorithms.
©Silberschatz, Korth and Sudarshan13.1Database System Concepts Chapter 13: Query Processing Overview Measures of Query Cost Selection Operation Sorting.
Lecture 10 Trees –Definiton of trees –Uses of trees –Operations on a tree.
Querying Structured Text in an XML Database By Xuemei Luo.
Trees Chapter 8. Chapter 8: Trees2 Chapter Objectives To learn how to use a tree to represent a hierarchical organization of information To learn how.
Chapter 11 Indexing & Hashing. 2 n Sophisticated database access methods n Basic concerns: access/insertion/deletion time, space overhead n Indexing 
Binary Trees, Binary Search Trees RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
© 2006 Pearson Addison-Wesley. All rights reserved13 B-1 Chapter 13 (continued) Advanced Implementation of Tables.
Advanced Databases: Lecture 6 Query Optimization (I) 1 Introduction to query processing + Implementing Relational Algebra Advanced Databases By Dr. Akhtar.
VLDB'02, Aug 20 Efficient Structural Joins on Indexed XML1 Efficient Structural Joins on Indexed XML Documents Shu-Yao Chien, Zografoula Vagena, Donghui.
Sorting. Pseudocode of Insertion Sort Insertion Sort To sort array A[0..n-1], sort A[0..n-2] recursively and then insert A[n-1] in its proper place among.
Trees Chapter 8. 2 Tree Terminology A tree consists of a collection of elements or nodes, organized hierarchically. The node at the top of a tree is called.
Prof. Amr Goneid, AUC1 CSCE 210 Data Structures and Algorithms Prof. Amr Goneid AUC Part 4. Trees.
Indexing and hashing Azita Keshmiri CS 157B. Basic concept An index for a file in a database system works the same way as the index in text book. For.
Chapter 12 Query Processing. Query Processing n Selection Operation n Sorting n Join Operation n Other Operations n Evaluation of Expressions 2.
Chapter 12 Query Processing (1) Yonsei University 2 nd Semester, 2013 Sanghyun Park.
1 CS 430: Information Discovery Lecture 4 Files Structures for Inverted Files.
Sept. 27, 2002 ISDB’02 Transforming XPath Queries for Bottom-Up Query Processing Yoshiharu Ishikawa Takaaki Nagai Hiroyuki Kitagawa University of Tsukuba.
CE Operating Systems Lecture 17 File systems – interface and implementation.
CS4432: Database Systems II Query Processing- Part 2.
Rooted Tree a b d ef i j g h c k root parent node (self) child descendent leaf (no children) e, i, k, g, h are leaves internal node (not a leaf) sibling.
CIS 250 Advanced Computer Applications Database Management Systems.
Grouping Robin Burke ECT 360. Outline Extra credit Numbering, revisited Grouping: Sibling difference method Uniquifying in XPath Grouping: Muenchian method.
Grouping Robin Burke ECT 360. Outline Grouping: Sibling difference method Uniquifying in XPath Grouping: Muenchian method Generated ids Keys Moded Templates.
Introduction to Database Systems1 External Sorting Query Processing: Topic 0.
1 Holistic Twig Joins: Optimal XML Pattern Matching Nicolas Bruno, Nick Koudas, Divesh Srivastava ACM SIGMOD 2002 Presented by Jun-Ki Min.
Holistic Twig Joins: Optimal XML Pattern Matching Nicholas Bruno, Nick Koudas, Divesh Srivastava ACM SIGMOD 02 Presented by: Li Wei, Dragomir Yankov.
BINARY TREES Objectives Define trees as data structures Define the terms associated with trees Discuss tree traversal algorithms Discuss a binary.
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2007.
Chapter 10 The Basics of Query Processing. Copyright © 2005 Pearson Addison-Wesley. All rights reserved External Sorting Sorting is used in implementing.
Indexing and Querying XML Data for Regular Path Expressions Quanzhong Li and Bongki Moon Dept. of Computer Science University of Arizona VLDB 2001.
Chapter 5 Ranking with Indexes. Indexes and Ranking n Indexes are designed to support search  Faster response time, supports updates n Text search engines.
1 Trees. 2 Trees Trees. Binary Trees Tree Traversal.
CSCE 210 Data Structures and Algorithms
Azita Keshmiri CS 157B Ch 12 indexing and hashing
Database Management System
Chapter 12: Query Processing
Lecture 2- Query Processing (continued)
Database Systems (資料庫系統)
Introduction to Data Structures
Structural Joins: A Primitive for Efficient XML Query Pattern Matching
Presentation transcript:

1 Indexing and Querying XML Data for Regular Path Expressions A Paper by Quanzhong Li and Bongki Moon Presented by Amnon Shochot

2 Our Objective Developing a system that will enable us to perform XML data queries efficiently.

3 XML Queries Languages Used for retrieving data from XML files. Use a regular path expression syntax. e.g. XPath, XQuery.

4 Queries Today - Inefficient Usually XML tree traversals – Inefficient. –Top-Down Approach –Bottom-Up Approach –An example: the query: /chapter/_*/figure (finding all figures in all chapters.)

5 Our Objective - Refined Developing a system that will enable us to perform XML data queries efficiently Developing such a system consists of: –Developing a way to efficiently store XML data. –Developing efficient algorithms for processing regular path expressions (e.g. XQuery expressions).

6 Storing XML Documents Question: What would we need from a data structure to be able to perform an efficient query? Answer: A mechanism for: –Efficiently finding all elements/attributes with a given name. –Efficiently finding all values with a given name. –Efficiently resolving ancestor-descendant relationship.

7 Storing XML Documents - XISS XISS - XML Indexing and Storage System. Provides us with ways to: –efficiently find all elements or attributes with the same name string grouped by document which they belong to. –quickly determine the ancestor-descendant relationship between elements and/or attributes in the hierarchy of XML data hierarchy.

8 Determining Ancestor-Descendent Relationship According to Dietz’s: for two given nodes x and y of a tree T, x is an ancestor of y iff x occurs before y in the preorder traversal and after y in the postorder traversal. Example:

9 Determining Ancestor-Descendent Relationship – cont. Advantage: the ancestor-descendent relationship can be determined in constant time. Disadvantage: a lack of flexibility. –e.g. inserting a new node requires recomputation of many tree nodes.

10 A new numbering scheme: –Each node is associated with a pair: For a tree node y and its parent x: [order(y), order(y) + size(y)]  (order(x), order(x) + size(x)] For two sibling nodes x and y, if x is the predecessor of y in preorder traversal holds: order(x) + size(x) < order(y). Determining Ancestor-Descendent Relationship – cont. exclusive

11 Determining Ancestor-Descendent Relationship – cont. Fact: for two given nodes x and y of a tree T, x is an ancestor of y iff: order(x) < order(y)  order(x) + size(x)

12 Determining Ancestor-Descendent Relationship – cont. Properties: –the ancestor-descendent relationship can be determined in constant time. –flexibility – node insertion usually doesn’t require recomputation of tree nodes. –an element can be uniquely identified in a document by its order value.

13 XISS System Overview

14 XISS System Overview How the system works: –XML documents are loaded into the XISS system. –These documents are added to the XISS data structures. Each document is assigned a document id (did). Index structures are organized as paged files for efficient disk IO. –When a query is performed the query processor interacts with XISS in order to obtain the information required for the query.

15 XISS - cont. XISS consists of 5 components: –Name Index –Value Table –Element Index –Attribute Index –Structure Index

16 Name Index and Value Table Objective: minimizing the storage and computation overhead by eliminating replicated strings and string comparisons. Name Index - mapping distinct name strings into unique name identifiers (nid). Value Table - mapping distinct value strings (i.e. attribute value and text value) into unique value identifiers (vid). Both implemented as a B + -tree.

17 The Element Index Objective: quickly finding all elements with the same name string. Structure:

18 The Element Index – cont. Structure: –B + -tree using nid as a key. –Leaf nodes: pointers to a set of records for elements (or attributes) having an identical name string, grouped by the document they belong to. –Element Record = {, Depth, Parent ID} where Depth is the depth of the element in the XML tree. –Element Records are ordered by.

19 The Attribute Index Objective: quickly finding all elements with the same name string. Structure: –Same structure as the Element Index except that the record in attribute index has a value identifier vid which is a key used to obtain the attribute from the value table.

20 The Structure Index Objectives: –Finding the parent element and child elements (or attributes) for a given element. –Finding the parent element for a given attribute. Structure:

21 The Structure Index – cont. Structure: –B + -tree using document identifier (did) as a key. –Leaf nodes: linear arrays with records for all elements and attributes from an XML document. –Each record: {nid,, Parent order, Child order, Sibling order, Attribute order}. –Records are ordered by order value.

22 Querying Method Decomposing path expressions into simple path expressions. Applying algorithms on simple path expressions and their intermediate results.

23 Decomposition of Path Expressions The main idea: –A complex path expression is decomposed into several simple path expressions. –Each simple path expression produces an intermediate result that can be used in the subsequent stage of processing. –The results of the simple path expressions are than combined or joined together to obtain the final result of the given query.

24 Basic Subexpressions - Example Decomposition of (E 1 /E 2 ) * / E 3 / ((E 4 | (E 5 /_ * /E 6 )): (1) Single Element/Attribute (2) Element-Attribute (3) Element-Element (4) Kleene Closure (5) Union / /_ * / *| [ ]/ / (4) (2) (3) (5) (3) (1)

25 Basic Subexpressions 5 basic subexpressions: (1) A subexpression with a single element or a single attribute. (2)A subexpression with an element and an attribute. e.g. = “Tree Frogs”] (3)A subexpression with two elements e.g. chapter/_*/figure where ‘_’ denotes any kind of node.

26 Basic Subexpressions - cont. 5 basic subexpressions - cont.: (4)A subexpression that is a Kleene closure ( +,*) of another subexpression. (5)A subexpression that is a union of two other subexpressions.

27 3 Algorithms 3 Algorithms: –EA-Join: Element and Attribute Join. –EE-Join: Element and Element Join –Kleene Closure

28 EA-Join: Element and Attribute Join Input: {E 1,…,E m }: E i is a set of elements having a common document identifier ( did ); {A 1,…,A n }: A j is a set of elements having a common document identifier ( did ); Output: A set of (e,a) pairs such that the element e is the parent of the attribute a.

29 EA-Join: Element and Attribute Join The Algorithm: // Sort-merge {E i } and {A j } by did. (1)foreach E i and A j with the same did do: // Sort-merge E i and A j by // PARENT-CHILD relationship (2)foreach e  E i and a  A j do (3)if (e is a parent of a) then output (e,a) end

30 EA-Join – Example Consider the XML document: And the query: Ele Att

31 Sort-merging “Ele”s and “Att”s by parent-child relation ship will give us the list:,,, Finding the elements “Ele”s with a child attribute “Att” with a value “A1” from the accepted list is easy using the information in the Element Record. EA-Join – Querying Ele Att

32 EA-Join – Comments Only a two-stage sort-merge operation without additional cost of sorting: –First merge: by did. –Second merge: by examining parent-child relationship. This merge is based on the order values of the element and attribute as defined by the numbering scheme. Attributes should be placed before their sibling elements in the order of the numbering scheme. –guarantees that elements and attributes with the same did can be merged in a single scan.

33 EE-Join: Element and Element Join Input: {E 1,…,E m } and {F 1,…,F m }: E i or F j is a set of elements having a common document identifier ( did ). Output: A set of (e,f) pairs such that element e is an ancestor of element f.

34 EE-Join: Element and Element Join The Algorithm: // Sort-merge {E i } and {F j } by did. (1)foreach E i and F j with the same did do: // Sort-merge E i and F j by the // ANCESTOR-DESCENDANT relationship. (2)foreach e  E i and f  F j do (3)if (e is an ancestor of f) then output (e,f); end

35 EE-Join – Comments Only two-stage sort-merge operation without the additional cost of sorting: –First merge: by did. –Second merge: by examining parent-child relationship. The sets of elements with a matching did cannot be merged in a single scan.

36 Kleene Closure Input: {E 1,…,E m }, where E i is a group of elements from an XML document. Output: A Kleene closure of {E 1,…,E m }.

37 The Algorithm: (1)Set i  1; (2)Set K i C  {E 1,…,E m }; (3)repeat (4)set i  i + 1; (5) set K i C  EE-Join(K i-1 C, K 1 C ); until (K i C is empty); (6) output the union of K 1 C,K 2 C,…, K i C ; Kleene Closure

38 Performance Experiments EE-Join: Results: –Real World: an order of magnitude faster. –Synthetic Data: 6 to 10 times faster.

39 Performance Experiments EA-Join: Results: –Compared to Top-Down: a better performance. –Compared to Bottom-Up: no winner - close results.

40 Performance Results - Conclusions The proposed algorithms can achieve performance improvement over the conventional methods (top-down and bottom- up tree traversals) by up to an order of magnitude.