Docsity

XML Indexing: Sequence-Based Indexing with ViST and DataGuides, Slides of Database Management Systems (DBMS)

Toggle sidebar
bg1
1
XML Indexing II
CPS 216
Advanced Database Systems
2
Announcements (April 14)
Homework #3 will be graded by next Tuesday
Reading assignment due next Monday
Selinger paper on query optimization
3
XML indexing overview (review)
It is a jungle out there
Different representation scheme lead to different indexes
Will we ever find the “One Tree” that rules them all?
Building blocks: B+-trees, inverted lists, tries, etc.
Indexes for node/edge-based representations (graph)
Indexes for interval-based representations (tree)
)Indexes for path-based representations (tree)
)Indexes for sequence-based representations (tree)
)Structural indexes (graph)
pf3
pf4
pf5

Partial preview of the text

Download XML Indexing: Sequence-Based Indexing with ViST and DataGuides and more Slides Database Management Systems (DBMS) in PDF only on Docsity!

XML Indexing II

CPS 216

Advanced Database Systems

2

Announcements (April 14)

™ Homework #3 will be graded by next Tuesday

™ Reading assignment due next Monday

ƒ Selinger paper on query optimization

3

XML indexing overview (review)

™ It is a jungle out there

ƒ Different representation scheme lead to different indexes

ƒ Will we ever find the “One Tree” that rules them all?

™ Building blocks: B +^ -trees, inverted lists, tries, etc.

™ Indexes for node/edge-based representations (graph)

™ Indexes for interval-based representations (tree)

) Indexes for path-based representations (tree)

) Indexes for sequence-based representations (tree)

) Structural indexes (graph)

ViST: a sequence-based index

Wang et al. “ViST: A Dynamic Index Method for Querying XML Data by Tree Structures.” SIGMOD 2003

™ Use a sequence-based encoding for XML

™ Turn twig queries to subsequence matches

™ Index sequences in a virtual trie using interval-based

encoding

5

Sequence representation of XML

™ A sequence of ( symbol , prefix ) pairs, in depth-first order:

ƒ (P, ε), (S, P), (I, PS), (N, PSI), ( v 1 , PSIN), (M, PSI), ( v 2 , PSIM), (I,

PSI), (M, PSII), ( v 3 , PSIIM), (I, PS), (N, PSI), ( v 4 , PSIN), (L, PS), ( v 5 , PSL), (N, PS), ( v 6 , PSN), (B, P), (L, PB), ( v 7 , PBL), (N, PB), ( v 8 , PBN)

) What is the worst-case storage requirement?

) Would listing symbols in depth-first order be sufficient?

6

Sequence representation of twigs

™ Twigs can be represented sequences as well

“Virtual trie” idea

™ Use ( left , size ) to encode trie nodes

ƒ size = right – left

ƒ Supports efficient “skipping”

™ Index in a regular B +^ -tree

™ No need to store the trie itself

11

ViST structures

™ D-Ancestor B+^ -tree indexes trie nodes by ( symbol , prefix )

ƒ Facilitates prefix matching (checking for ancestor-descendent relationships in documents)

™ Leaf nodes point to S-Ancestor B +^ -trees, which further

index nodes by ( left , size )

ƒ Facilitates skipping in the trie (checking for ancestor-descendent relationships in the trie)

™ Subsequence matching →

repeated index lookups

12

Lore’s DataGuide: a structural index

Goldman & Widom. “DataGuides: Enabling Query Formulation and Optimization in Semistructured Databases.” VLDB , 1997

™ Given an XML data graph G , a DataGuide is an index

graph I with the following properties

ƒ Every label path in G also occurs in I

  • Complete coverage ƒ Every label path in I also occurs in G
  • Accurate coverage ƒ Every label path in I (starting from a particular object) is unique (i.e., I is a DFA)
  • Efficient search: a label path of length n traverses n edges and ends at one node ƒ Each index node in I points to its extent: a set of data nodes in G
  • Label path query on G → label path query on I

Strong DataGuide

™ Let p , p ’ be two label path expressions and G a graph; define

p ≡ G p ’ if p ( G ) = p ’( G )

ƒ That is, p and p ’ are indistinguishable on G

™ I is a strong DataGuide for a database G if the equivalence

relations ≡ I and ≡ G are the same

™ Example

ƒ I 1 is strong; I 2 is not ƒ A.C( G ) = { 5 }, B.C( G ) = { 6, 7 }

  • Not equal ƒ A.C( I 2 ) = { 20 }, B.C( I 2 ) = { 20 }
  • Equal

G I 1 I 2

14

Size of DataGuides

™ If G is a tree, then | I | · | G |

ƒ Linear construction time

™ In the worst case, the size of a strong DataGuide may be

exponential in | G | because of the DFA requirement

) Relax the DFA requirement?

o 1

o 2 o 3

o (^4) o 5 o 6

A A

B B B

B

B

15

NFA-based structural indexes

™ Defined using an equivalence relation (based on the graph

structure)

ƒ Each index node v corresponds to an equivalence class of data nodes in G (denoted v. extent ) ƒ There is a edge from u to v in I iff there exists a edge from a node in u. extent to a node in v. extent

) | I | · | G | by definition because extents do not overlap;

however, the structure is no longer a DFA

u

v