Download presentation
Presentation is loading. Please wait.
Published byMicah Kingsford Modified over 9 years ago
1
Efficient Processing Regular Queries In Shared-Nothing Parallel Database Systems Using Tree- And Structural Indexes (ADBIS 2007, Bulgaria) Vu Le Anh, Attilla Kiss Department of Information Systems, Eötvös Loránd University, Hungary Under the support of the Hungarian National Office for Research and Technology under grant no. RET14/2005.
2
Outline Problem State-of-art of the problem: Streaming approach vs. Partial Parallel approach Our efficient algorithm: Tree index & Structural index Experiments Summary
3
Problem Shared-Nothing Parallel Database System Fragmented XML Tree Regular queries
4
Shared-Nothing Parallel Database System 2 - thousands sites connecting by an interconnection network Each site: non-shared memory, non-shared disk and own processor The cost per processor may be extremely low because each node is an inexpensive processor Interconnection network Disk memory P1 memory P2 memory Pn …
5
Shared-Nothing Parallel Database System Parallel processing Provide incremental and unlimited growth Failure is local: if one node fails, the others stay up The cost of system may be very cheap
6
Fragmented XML Tree A AB CBAD ADBE DCEAF F0F0 F2F2 F4F4 F5F5 F1F1 0 F3F3 1 2 3 45 10 6 7 8 9 12 14 13 1511 Nodes : 0,1,…,15 Label values: A,B,…,F Fragments : F 0, F 1,…, F 5 F 0 = {0,1,2,6} F 1 = {3,4,5} … Sites: S 0, S 1 S 0 ={F 0,F 4,F 5 }, S 1 ={F 1,F 2,F 3 } Site = machine 1 Master site + Slaver sites Master server: - Communicating with the Clients - Controling the Slavers processing queries
7
Regular queries A variety of query languages have been proposed for XML data: UnQL, Lorel, XQL, XML- QL, etc. All of them are built around regular path expressions. Three basic operations: Union, Concatenation and Iteration. Every regular path expression can be determined by a finite deterministic automata.
8
Example regular query Query: //B/D. Query graph: A A B 0 1 8 CB26 AD913 A D BE 3 10 7 14 D CA F 4 5 1211E 15 * BD q0q0 q1q1 q2q2 q0q0 q0q0 q0q0 q0q0 q0q0 q 0 q 2 q1q1 q0q0 Answers = {3,11,13}
9
Problem Problem: -Nodes are in different fragments 2 approaches: Streaming approach vs. Partial Parallel approach A A B 0 1 2 q0q0 q0q0 q 0 q 1 F1F1 F0F0
10
Basic operation: Fragment Process Fragment-Process(F,q): -Traverse the fragment F and the query graph begin at the root of F and state q -While processing if a link edge is traversed, different processes will have different behavior
11
Streaming Approach If a link edge F F’ is traversed: 1.Current fragment process operation over F is stopped. 2.The corresponding fragment process operation over F’ is started 3.If 2 finishes 2 sends the result to 1, 1 will be resumed
12
Streaming Approach A F0F0 0 F3F3 1 2 A B8 F2F2 F4F4 F1F1 3 45 10 6 12 14 13 1511AC D CB F E D D B A A E 7 F5F5 Sequence of events: 1. (F 0,q 0 ) is started 2. Link edge (2,3) is traversed 3. (F 0,q 0 ) is stopped 4. (F 1,q 0 ) is started 5. (F 0,q 0 ) is resumed 6. Link edge (2,3) is traversed again 7. (F 0,q 0 ) is stopped 8. (F 1,q 2 ) is started, {3} is sent to F 0 9. (F 0,q 0 ) is resumed … No parallelism, the waiting time is high
13
Partial Parallel Approach When fragment process operation is processed there is no communication with other sites If a link edge (F, q) (F’, q’) is traversed: -Write down the fact: If (F, q) is processed (F’, q’) will be processed These facts will be sent to the Master to find out all the operations which are reachable Only the results of the reachable operations are sent to the Master
14
Partial Parallel Approach A F0F0 0 F3F3 1 2 A B8 F2F2 F4F4 F1F1 3 45 10 6 12 14 13 1511AC D CB F E D D B A A E 7 F5F5 Sequence of events: 1.All fragment process operations of S 0 and S 1 are executed in parallel 2. S 1 = {F 1, F 2, F 3 } Operations: (F 1,q 0 ), (F 1,q 1 ), (F 1,q 2 ) (F 2,q 0 ), (F 2,q 1 ), (F 2,q 2 ),(F 3,q 0 ), (F 3,q 1 ), (F 3,q 2 ) 3. The list of facts: (F 3,q 0 ) (F 4,q 0 ) (F 3,q 0 ) (F 5,q 0 ) (F 3,q 0 ) (F 5,q 1 ) 4. List of reachable operations: (F 1,q 0 ), (F 1,q 1 ), (F 2,q 0 ), (F 3,q 0 ) 5. Sending the results of reachable operations to the Master S 0 = {F 0, F 4, F 5 } S 1 = {F 1, F 2, F 3 }
15
Our algorithm Partial Parallel Approach -Advantages: Parallelism, the number of communication is constant and each fragment is scanned maximum once -Disadvantages: many unnecessary operations Our algorithm: -Based on the partial evaluation -Restrain the unnecessary operations
16
Unnecessary operations Unnecessary operations type I: Def: Unreachable operations Solution: -Determined by Tree Index - Tree Index is stored in Master storing all paths connecting between the roots of Fragments Unnecessary operations type II: Def: Return no result Solution: -Restrained by structural indexes -Structural indexes = Simulators of Fragments
17
Tree Index A F0F0 0 F3F3 1 2 A B8 F2F2 F4F4 F1F1 3 45 10 6 12 14 13 1511AC D CB F E D D B A A E 7 F5F5 Tree Index AF0F0 AF2F2 BF3F3 BF4F4 DF1F1 DF5F5 ε AB AC A ε q0q0 q 0 q 1 (F 2,q 1 ), (F 2,q 2 ): unreachable q0q0 q0q0 q0q0 q 0 q 1 Reachable operations: (F 0,q 0 ), (F 1,q 0 ), … The size of tree index = The number of Fragments The process cost can be ignored
18
Structural Indexes Simulating the fragment by a index graph Processing over the index graph is safe. Using as necessary condition (if an operation returns no result over the index graph, it also returns no result over the fragment ) The size of the index should be constant so that the cost of pre-processing is minimized
19
DL-Indexes A5 Fragment A10 D8B7D9B6 C11C12C13A14 F16E15E17E18 A19A20A21A22 DL Index A B,D A,C E,F A Simulating * BD q0q0 q1q1 q2q2 (F,q 0 ), (F,q 1 ) and (F,q 2 ): unnecessary operations type II q0q0 q0q0 q 0 q 1 q0q0 q0q0
20
Our Algorithm 1.The Master determines the reachable operations by the tree-index 2.For each reachable operation, using the corresponding structural index to check out if it is a unnecessary operation type 2. 3.Sending the „good” operations to each sites 4.Each site processes the operations and send back to the Master
21
Experiments Comparing the performance of three algorithm: Our algorithm (EPP), Partial Processing algorithm (PP) and Streaming Processing algorithm (TP) System: 19 Linux machines connecting by local network Data set: 500 Mb 76 fragments: randomly stored in servers Queries: 10 Queries representing for different conditions of the environment
22
Experiments Waiting time: EPP : PP : TP = 1 : 1.94 : 37.52 The waiting time of TP extremely high since there is no parallelism Processing and Communication Cost: EPP : PP : TP = 1 : 1.77 : 2.75 In some cases the total cost of PP is higher than TP because of redundant operation type 2 EPP is the best
23
Summary Introduce an efficient algorithm processing regular queries in shared-nothing based on partial evaluation Two types of unnecessary operations: - Type 1: Unreachable operations. Restrained by processing over the tree index - Type 2: Returning no matching nodes. Restrained by processing over structural indexes Experiments: Our algorithm overcomes the classical algorithms according the waiting time and processing and communication cost criteria
24
Thank you. Question?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.