Holistic Twig Joins on Indexed XML Documents 6 - PowerPoint PPT Presentation

1 / 183
About This Presentation
Title:

Holistic Twig Joins on Indexed XML Documents 6

Description:

by Haifeng Jiang, Wei Wang, Hongjun Lu, and Jeffrey Xu Yu. Presented by: Teddy ... [2] Nicolas Bruno, Nick Koudas, and Divesh Srivastava, 'Holistic Twig Joins: ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 184
Provided by: TeddyN
Category:

less

Transcript and Presenter's Notes

Title: Holistic Twig Joins on Indexed XML Documents 6


1
Holistic Twig Joins on Indexed XML Documents 6
  • by Haifeng Jiang, Wei Wang, Hongjun Lu, and
    Jeffrey Xu Yu
  • Presented by Teddy Yap, Jr.
  • CS267, April 14, 2004

2
Outline of Presentation
  • Looking Back
  • Introduction and Motivation
  • Background and Related Work
  • The Generic Twig Join Algorithm
  • The TSGeneric Algorithm
  • A Performance Study
  • Conclusions

3
Outline of Presentation
  • Looking Back
  • Introduction and Motivation
  • Background and Related Work
  • The Generic Twig Join Algorithm
  • The TSGeneric Algorithm
  • A Performance Study
  • Conclusions

4
Looking Back
  • 1 S. Al-Khalifa, H. V. Jagadish, N. Koudas, J.
    M. Patel, D. Srivastava, and Y. Wu, Structural
    Joins A Primitive for Efficient XML Query
    Pattern Matching. Proc. ICDE Conf. 2002.

XML query pattern
Results
XML Database
5
Looking Back (2)
6
Looking Back (3)
7
Looking Back (4)
8
Looking Back (5)
9
Looking Back (6)
10
Looking Back (7)
11
Looking Back (8)
  • 3 S.-Y. Chien, Z. Vagena, D. Zhang, V. J.
    Tsotras, and C. Zaniolo, Efficient Structural
    Joins on Indexed XML Documents. Proc. of VLDB
    Conf., 2002.

12
Looking Back (9)
13
Looking Back (10)
14
Looking Back (11)
  • 5 Haifeng Jiang, Hongjun Lu, Wei Wang, and Beng
    Chin Ooi, XR-Tree Indexing XML Data for
    Efficient Structural Joins. Proc. of ICDE
    Conf., 2003.

15
Looking Back (12)
16
Looking Back (13)
  • 2 Nicolas Bruno, Nick Koudas, and Divesh
    Srivastava, Holistic Twig Joins Optimal XML
    Pattern Matching. Proc. of ACM SIGMOD Conf.
    2002.

17
Looking Back (14)
18
Outline of Presentation
  • Looking Back
  • Introduction and Motivation
  • Background and Related Work
  • The Generic Twig Join Algorithm
  • The TSGeneric Algorithm
  • A Performance Study
  • Conclusions

19
Introduction and Motivation
  • XML emerging as a de facto standard for
    information exchange over the Internet
  • XML documents modeled as ordered trees
  • XML queries specify patterns of selection
    predicates on multiple elements having some
    structural relationships (parent-child,
    ancestor-descendant)

20
Introduction and Motivation (2)
  • Sample XML query
  • //section//paragraphfigure AND table

21
Introduction and Motivation (3)
  • Locating all occurrences of a twig pattern is a
    core operation in XML query processing.

Decomposition Approach
section
section
paragraph
paragraph
paragraph
paragraph
figure
table
figure
table
22
Introduction and Motivation (4)
  • Disadvantage of the decomposition approach
    Intermediate result sizes can get very large,
    even when the input and the final result sizes
    are much more manageable.
  • Solution Holistic twig join approach for
    matching XML query twig patterns 2

23
Introduction and Motivation (5)
  • Motivation Although the proposed holistic twig
    join algorithm 2 has been proven to be I/O and
    CPU optimal in terms of input and output sizes
    for twigs with only ancestor-descendant edges,
    the potential benefit of skipping elements that
    do not participate in the final twig match by
    using available indices (e.g. B-trees, XR-trees)
    is not fully explored.

24
Introduction and Motivation (6)
  • In a nutshell
  • A generic algorithm TSGeneric which can utilize
    available indices (e.g. XR-trees 5) on element
    sets to quickly locate the first match for a sub
    twig pattern thus skipping those edges that do
    not comply with the desired structural
    relationship (e.g. ancestor-descendant
    relationship) with a structural join like
    algorithm.

25
Introduction and Motivation (7)
  • Main issue
  • Which edge to choose first so that more elements
    without matches can be skipped?
  • Three edge-picking heuristics
  • Top-down
  • bottom-up
  • Statistics-based

26
Outline of Presentation
  • Looking Back
  • Introduction and Motivation
  • Background and Related Work
  • The Generic Twig Join Algorithm
  • The TSGeneric Algorithm
  • A Performance Study
  • Conclusions

27
Background and Related Work
  • Data model and numbering scheme

28
Background and Related Work (2)
  • Corollary 1
  • Given two elements ei and ej, if ei.start lt
    ej.start and ei is not an ancestor of ej, then ei
    will not be an ancestor of any element ex with
    ex.start gt ej.start.

ei
ej
29
Background and Related Work (3)
  • Structural Joins
  • A structural join is to find all occurrences of a
    given structural relationship between two sets of
    elements.
  • Algorithms
  • MPMGJN 8
  • ? ?/ ?A-Join 7
  • Stack-Tree-Desc/Anc 1
  • Index-based approaches 3, 4, 5

30
Background and Related Work (4)
  • Twig Pattern Matching
  • Given a query twig pattern Q and an XML database
    D, a match of Q in D is identified by a mapping
    from nodes in Q to nodes in D, s.t.
  • query node predicates are satisfied by the
    corresponding database nodes
  • the structural relationships between query nodes
    are satisfied by the corresponding database nodes.

Answer (d1, d2, , dn)
31
Background and Related Work (5)
  • Related Work
  • 2 Nicolas Bruno, Nick Koudas, and Divesh
    Srivastava, Holistic Twig Joins Optimal XML
    Pattern Matching. Proc. of ACM SIGMOD Conf.
    2002.

32
Outline of Presentation
  • Looking Back
  • Introduction and Motivation
  • Background and Related Work
  • The Generic Twig Join Algorithm
  • The TSGeneric Algorithm
  • A Performance Study
  • Conclusions

33
The Generic Twig Join Algorithm
  • Preliminaries
  • isRoot(q)
  • isLeaf(q)
  • children(q)
  • parent(q)
  • subtreeNodes(q)

34
The Generic Twig Join Algorithm (2)
  • Assumptions
  • Each node in the query tree has an associated
    data stream.
  • Every element in the data stream is already
    encoded in the following region format (start,
    end, level) and sorted on the start attribute.
  • 2 types of data structures for every node q ? T
    cursor (Cq) and stack (Sq).

35
The Generic Twig Join Algorithm (3)
  • Illustration

36
The Generic Twig Join Algorithm (4)
  • Sample XML Document

37
The Generic Twig Join Algorithm (5)
Ca
a
a1, a2, a3, a4, a5, a6, a7
Cb
Sa
b1, b2, b3, b4, b5
b
Sc
Sb
Cc
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
c
38
The Generic Twig Join Algorithm (6)
  • Notation
  • The cursor Cq is simply a pointer to some element
    in the data stream for node q.
  • Methods and Attributes
  • Cq -gt advance( ) move to next element
  • Cq -gt start
  • Cq -gt end
  • Cq -gt level

39
The Generic Twig Join Algorithm (7)
  • Initial Configuration
  • All stacks are empty.
  • All cursors point to the first element of the
    corresponding data stream.

40
The Generic Twig Join Algorithm (8)
  • Stack Sq
  • Used to cache some elements before the cursor Cq
  • Elements are strictly nested from bottom to top.
  • Each element e in Sq has a pointer to the lowest
    ancestor in Sparent(q).
  • Cached elements represent partial results than
    can be extended further.

41
The Generic Twig Join Algorithm (9)
  • Illustration

42
The Generic Twig Join Algorithm (10)
  • Definition (Solution Extension)
  • We say that a node q has a solution extension if
    there is a solution for the sub query rooted at q
    composed entirely of the cursor elements of the
    query nodes in the sub query.

43
The Generic Twig Join Algorithm (11)
  • Implication
  • If node q has a solution extension, since Cq is
    the ancestor of all cursor elements in the sub
    query tree nodes, Cq -gt start is smaller than all
    cursor start values of query nodes in the subtree
    q.

44
The Generic Twig Join Algorithm (12)
  • getNext(q)

45
The Generic Twig Join Algorithm (13)
  • getNext(q)
  • Returns a query node qx in the subtree q
    satisfying all the following
  • qx has a solution extension.
  • if qx has siblings, Cqx -gt start lt Cqs -gt start
    for all sibling qs of qx.
  • If qx ? q, Cparent(qx) -gt start gt Cqx -gt start.

46
The Generic Twig Join Algorithm (14)
  • getNext(q)

If q is a leaf, return q.
If q is not a leaf, determine if the children of
q has solution extension rooted at them,
else return descendant of q with
solution extension.
Determine descendant of q with minimum and
maximum start attribute. Advance cursor of q so
so that Cq -gt end gt Cnmax -gt start. If Cq -gt
start lt Cnmin -gt start return node q, else return
descendant nmin of q with minimum start attribute.
Corollary 1
47
The Generic Twig Join Algorithm (15)
  • getNext(q) (Examples)

48
The Generic Twig Join Algorithm (16)
  • getNext(q) (Examples)

getNext(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
49
The Generic Twig Join Algorithm (16)
  • getNext(q) (Examples)

getNext(root) c
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
50
The Generic Twig Join Algorithm (17)
  • getNext(q) (Examples)

getNext(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
51
The Generic Twig Join Algorithm (17)
  • getNext(q) (Examples)

getNext(root) c
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
52
The Generic Twig Join Algorithm (18)
  • getNext(q) (Examples)

getNext(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
53
The Generic Twig Join Algorithm (18)
  • getNext(q) (Examples)

getNext(root) c
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
54
The Generic Twig Join Algorithm (19)
  • getNext(q) (Examples)

getNext(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
55
The Generic Twig Join Algorithm (19)
  • getNext(q) (Examples)

getNext(root) c
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
56
The Generic Twig Join Algorithm (20)
  • getNext(q) (Examples)

getNext(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
57
The Generic Twig Join Algorithm (20)
  • getNext(q) (Examples)

getNext(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
58
The Generic Twig Join Algorithm (20)
  • getNext(q) (Examples)

getNext(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
59
The Generic Twig Join Algorithm (20)
  • getNext(q) (Examples)

getNext(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
60
The Generic Twig Join Algorithm (20)
  • getNext(q) (Examples)

getNext(root) b
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
61
The Generic Twig Join Algorithm (21)
  • TSGeneric(root)

62
The Generic Twig Join Algorithm (22)
  • TSGeneric(root)

Get node q with solution extension.
63
The Generic Twig Join Algorithm (22)
  • TSGeneric(root)

If node q is not a root node, pop all
elements that are not ancestor of Cq from its
parents stack.
64
The Generic Twig Join Algorithm (22)
  • TSGeneric(root)

If node q is a root node or its parent stack is
not empty, pop all elements from Sq that are not
ancestors of Cq. If node q is not a leaf, push
the pair (Cq, top(Sparent(q))) onto stack Sq
where top(Sparent(q)) returns a pointer to the
top element in Sparent(q). Otherwise, output
path solutions.
65
The Generic Twig Join Algorithm (22)
  • TSGeneric(root)

Advance cursor Cq so it points to the
next element in the data stream for node q.
66
The Generic Twig Join Algorithm (22)
  • TSGeneric(root)

Merge all path solutions.
67
The Generic Twig Join Algorithm (23)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
68
The Generic Twig Join Algorithm (23)
  • TSGeneric (Examples)

getNext(root) b
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
69
The Generic Twig Join Algorithm (24)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
70
The Generic Twig Join Algorithm (24)
  • TSGeneric (Examples)

getNext(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
71
The Generic Twig Join Algorithm (25)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
72
The Generic Twig Join Algorithm (25)
  • TSGeneric (Examples)

getNext(root) b
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
73
The Generic Twig Join Algorithm (26)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
74
The Generic Twig Join Algorithm (26)
  • TSGeneric (Examples)

getNext(root) b
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
75
The Generic Twig Join Algorithm (27)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
76
The Generic Twig Join Algorithm (27)
  • TSGeneric (Examples)

getNext(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
77
The Generic Twig Join Algorithm (28)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
78
The Generic Twig Join Algorithm (28)
  • TSGeneric (Examples)

getNext(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
79
The Generic Twig Join Algorithm (29)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
80
The Generic Twig Join Algorithm (29)
  • TSGeneric (Examples)

getNext(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
81
The Generic Twig Join Algorithm (30)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
82
The Generic Twig Join Algorithm (30)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
83
The Generic Twig Join Algorithm (30)
  • TSGeneric (Examples)

getNext(root) a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
84
The Generic Twig Join Algorithm (31)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
85
The Generic Twig Join Algorithm (31)
  • TSGeneric (Examples)

getNext(root) b
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
86
The Generic Twig Join Algorithm (32)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b4
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
87
The Generic Twig Join Algorithm (32)
Output (a7, b4, c9)
  • TSGeneric (Examples)

getNext(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b4
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
88
The Generic Twig Join Algorithm (33)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b4
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
89
The Generic Twig Join Algorithm (33)
Output (a7, b4, c10)
  • TSGeneric (Examples)

getNext(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b4
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
90
The Generic Twig Join Algorithm (34)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b4
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
91
The Generic Twig Join Algorithm (34)
  • TSGeneric (Examples)

getNext(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
92
The Generic Twig Join Algorithm (35)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
93
The Generic Twig Join Algorithm (35)
  • TSGeneric (Examples)

getNext(root) b
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
94
The Generic Twig Join Algorithm (36)
  • TSGeneric (Examples)

getNext(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b5
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
95
The Generic Twig Join Algorithm (36)
Output (a7, b5, c12)
  • TSGeneric (Examples)

getNext(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b5
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
96
The Generic Twig Join Algorithm (37)
  • TSGeneric (Examples)

a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
a7
b5
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
97
The Generic Twig Join Algorithm (38)
  • TSGeneric
  • Can we accelerate twig join processing in
    TSGeneric by taking advantage of available
    indices?
  • Answer Sure.

98
The Generic Twig Join Algorithm (39)
  • Two New Methods
  • Cq -gt fwdBeyond(Cp) forwards Cq to the first
    element e, such that e.start gt Cp -gt start.
  • Cq -gt fwdToAncestorOf(Cp) forwards the cursor to
    the first ancestor of Cp and returns TRUE. If no
    such ancestor exists, it stops at the first
    element e, such that e.start gt Cp -gt start, and
    returns FALSE.

99
The Generic Twig Join Algorithm (40)
  • getNextCursor(q)

100
The Generic Twig Join Algorithm (41)
  • getNextCursor(q)

If we find a common ancestor for all
child cursors, we return q otherwise, we
return the child node with minimum start value.
101
The Generic Twig Join Algorithm (42)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
102
The Generic Twig Join Algorithm (42)
  • getNextCursor(q) (Ex.)

getNextCursor(root) c
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
103
The Generic Twig Join Algorithm (43)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
104
The Generic Twig Join Algorithm (43)
  • getNextCursor(q) (Ex.)

getNextCursor(root) c
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
105
The Generic Twig Join Algorithm (44)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
106
The Generic Twig Join Algorithm (44)
  • getNextCursor(q) (Ex.)

getNextCursor(root) c
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
107
The Generic Twig Join Algorithm (45)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
108
The Generic Twig Join Algorithm (45)
  • getNextCursor(q) (Ex.)

getNextCursor(root) c
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Ca
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
109
The Generic Twig Join Algorithm (46)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
110
The Generic Twig Join Algorithm (46)
  • getNextCursor(q) (Ex.)

getNextCursor(root) b
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
111
The Generic Twig Join Algorithm (47)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
112
The Generic Twig Join Algorithm (47)
  • getNextCursor(q) (Ex.)

getNextCursor(root) c
a
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b
b3
c1
c2
c4
c8
c11
c
c3
c5
c6
c7
c9
c10
c12
Data Streams and Cursors
Cb
Cc
a1, a2, a3, a4, a5, a6, a7
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
113
The Generic Twig Join Algorithm (48)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
114
The Generic Twig Join Algorithm (48)
  • getNextCursor(q) (Ex.)

getNextCursor(root) b
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
115
The Generic Twig Join Algorithm (49)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
116
The Generic Twig Join Algorithm (49)
  • getNextCursor(q) (Ex.)

getNextCursor(root) b
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
117
The Generic Twig Join Algorithm (50)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
118
The Generic Twig Join Algorithm (50)
  • getNextCursor(q) (Ex.)

getNextCursor(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
119
The Generic Twig Join Algorithm (51)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
120
The Generic Twig Join Algorithm (51)
  • getNextCursor(q) (Ex.)

getNextCursor(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
121
The Generic Twig Join Algorithm (52)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
122
The Generic Twig Join Algorithm (52)
  • getNextCursor(q) (Ex.)

getNextCursor(root) c
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
123
The Generic Twig Join Algorithm (53)
  • getNextCursor(q) (Ex.)

getNextCursor(root) ?
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
c4
c8
c11
c3
c5
c6
c7
c9
c10
c12
Ca
a1, a2, a3, a4, a5, a6, a7
Cb
Cc
b1, b2, b3, b4, b5
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12
Sc
Sb
Sa
124
The Generic Twig Join Algorithm (53)
  • getNextCursor(q) (Ex.)

getNextCursor(root) b
a1
a5
a7
a2
a4
a6
a3
b1
b2
b4
b5
b3
c1
c2
Write a Comment
User Comments (0)
About PowerShow.com