Efficient Processing of Updates in Dynamic XML Data Changqing Li, Tok Wang Ling, Min Hu
ICDE'06Efficient Processing of Updates in XML2 Outline Background and related work Our proposals –Lexicographical order –A compact dynamic binary string encoding (CDBS) –Applying CDBS to different labeling schemes for update processing –Experimental evaluation Conclusion
ICDE'06Efficient Processing of Updates in XML3 Background and related work: Labeling schemes Three main categories of labeling schemes to process XML queries –(1) Containment labeling scheme [Zhang et al SIGMOD01 etc.] –(2) Prefix labeling scheme [Tatarinov et al SIGMOD02 etc.] –(3) Prime number labeling scheme [Wu et al ICDE04] In this talk, we focus on the labeling schemes to efficiently process updates
ICDE'06Efficient Processing of Updates in XML4 (1) Containment scheme Each node is assigned with three values, i.e. “ start ”, “ end ”, and “ level ” Based on “ start ”, “ end ”, and “ level ” to determine different relationships 1,18,1 2,3,24,9,210,11,2 12,17,2 5,6,37,8,315,16,313,14,3
ICDE'06Efficient Processing of Updates in XML5 Containment is bad to process updates Need to re-label all the ancestor nodes and all the nodes after the inserted node in document order 1,18,1 2,3,24,9,210,11,2 12,17,2 5,6,37,8,315,16,313,14,3
ICDE'06Efficient Processing of Updates in XML6 Containment is bad to process updates Need to re-label all the ancestor nodes and all the nodes after the inserted node in document order 1,20,1 2,3,24,9,212,13,2 14,19,2 5,6,37,8,317,18,315,16,3 10,11,2
ICDE'06Efficient Processing of Updates in XML7 Existing approaches to process the updates in containment scheme Increase the interval size and leave some values unused for the future insertions [Li et al VLDB01] –When unused values are used up, have to re-label Use float-point value [Amagasa et al ICDE03] –Float-point value represented in a computer with a fixed number of bits –Due to float-point precision, have to re-label They both can not avoid the re-labeling
ICDE'06Efficient Processing of Updates in XML8 (2) Prefix scheme Three main prefix schemes –DeweyID [Tatarinov et al SIGMOD02] –BinaryString [Cohen et al PODS02] –OrdPath [O'Neil et al SIGMOD04]
ICDE'06Efficient Processing of Updates in XML9 DeweyID (Cont.) Determine different relationships based on the prefix property
ICDE'06Efficient Processing of Updates in XML10 DeweyID is bad to process order- sensitive updates Order-sensitive updates: to maintain the document order when updates are performed –Need to re-label all the sibling nodes after the inserted node and all the descendants of these siblings
ICDE'06Efficient Processing of Updates in XML11 DeweyID is bad to process order- sensitive updates Order-sensitive updates: to maintain the document order when updates are performed –Need to re-label all the sibling nodes after the inserted node and all the descendants of these siblings
ICDE'06Efficient Processing of Updates in XML12 Existing approaches to process the updates in prefix scheme: OrdPath OrdPath [O'Neil et al SIGMOD04] –Similar to DeweyID –But at the beginning, use odd numbers only
ICDE'06Efficient Processing of Updates in XML13 Existing approaches to process the updates in prefix scheme: OrdPath OrdPath a bdc Label of node a “ -1 ” Label of node b “ 4.1 ” Label of node c “ 4.3 ” Label of node d “ ” They are siblings, but their labels look very different
ICDE'06Efficient Processing of Updates in XML14 (3) Prime number scheme [Wu et al ICDE04] Prime re-calculate the SC value to maintain the document order instead of re-labeling. But re-calculation is much more expensive.
ICDE'06Efficient Processing of Updates in XML15 Our CDBS encoding (1) Lexicographical order (2) Encoding (3) Applications and processing of updates (4) Experimental results
ICDE'06Efficient Processing of Updates in XML16 (1) Lexicographical order of binary string Given two binary strings “ 0011 ” and “ 01 ”, “ 0011 ” “ 01 ” lexicographically because the comparison is from left to right, and the 2 nd bit of “ 0011 ” is “ 0 ”, while the 2 nd bit of “ 01 ” is “ 1 ”. “ 0011 ” < “ 01 ” Given two binary strings “ 01 ” and “ 0101 ”, “ 01 ” “ 0101 ” lexicographically because “ 01 ” is a prefix of “ 0101 ”. “01” < “0101”
ICDE'06Efficient Processing of Updates in XML17 Find a binary string between two binary strings lexicographically To insert a binary string between “0011” and “01” –the size of “0011” is 4 which is larger than the size 2 of “01”; this is Case (a) (larger than or equal) –therefore we directly concatenate one more “1” after “0011”. –The inserted binary string is “00111”, and “0011” < “ ” < “ 01 ” lexicographically. To insert a binary string between “ 01 ” and “ 0101 ” –the size of “ 01 ” is 2 which is smaller than the size 4 of “ 0101 ” ; this is Case (b) (smaller than) –therefore we change the last bit “ 1 ” of “ 0101 ” to “ 01 ”, i.e. the inserted binary string is “ ” ; “ 01 ” < “ ” < “ 0101 ” lexicographically.
ICDE'06Efficient Processing of Updates in XML18 (2) Compact encoding Achieved the dynamic objective. Further, we need to propose a Compact Dynamic Binary String encoding, called CDBS.
ICDE'06Efficient Processing of Updates in XML19 Example illustration of CDBS We show how to encode 18 numbers based on our CDBS encoding This is only an example, any other numbers can be encoded with our CDBS 1,18,1 2,3,24,9,210,11,2 12,17,2 5,6,37,8,315,16,313,14,3
ICDE'06Efficient Processing of Updates in XML20 Integer numberV-Binary Total size (bits) 64
ICDE'06Efficient Processing of Updates in XML21 Integer numberV-BinaryF-Binary Total size (bits) 6490
ICDE'06Efficient Processing of Updates in XML22 Integer numberV-BinaryV-CDBSF-Binary Total size (bits) 6490
ICDE'06Efficient Processing of Updates in XML23 Integer numberV-BinaryV-CDBSF-Binary Total size (bits) 6490
ICDE'06Efficient Processing of Updates in XML24 Integer numberV-BinaryV-CDBSF-Binary Total size (bits) 6490
ICDE'06Efficient Processing of Updates in XML25 Integer numberV-BinaryV-CDBSF-Binary Total size (bits) 6490
ICDE'06Efficient Processing of Updates in XML26 Integer numberV-BinaryV-CDBSF-Binary Total size (bits) 64 90
ICDE'06Efficient Processing of Updates in XML27 Integer numberV-BinaryV-CDBSF-BinaryF-CDBS Total size (bits) 64 90
ICDE'06Efficient Processing of Updates in XML28 (3) Applying CDBS to the containment scheme Replace the “start” and “end” values 1 to 18 with our CDBS encoding Based on the lexicographical order comparison Level is still the same 00001,1111,1 0001,001,20011,0111,21,10001,2 1001,111,2 01,01001,30101,011,311,1101,3101,1011,3
ICDE'06Efficient Processing of Updates in XML29 Applying CDBS to the prefix scheme The CDBS codes for 4 numbers are “001”, “01”, “1” and “11”. The CDBS codes for 2 numbers are “01” and “1”
ICDE'06Efficient Processing of Updates in XML30 Applying CDBS to the prime scheme Store the document order with our CDBS codes. Based on the lexicographical order to determine the orders of nodes. The size of Prime and the query performance of Prime are bad, so we do not show the details.
ICDE'06Efficient Processing of Updates in XML31 Processing updates based on CDBS: for containment scheme To insert two binary strings between “0011” and “01”, the inserted two binary strings will be “00111” and “001111”. The complete label of the inserted node is “00111,001111,3” No need to re-label the existing nodes, but different relationships, e.g. ancestor-descendant etc., can be determined, and the orders can be kept ,1111,1 0001,001,20011,0111,21,10001,2 1001,111,2 01,01001,30101,011,311,1101,3101,1011,3
ICDE'06Efficient Processing of Updates in XML32 Processing updates based on CDBS: for prefix scheme To insert a binary string before “01”, the inserted binary string will be “001” The complete label of the inserted node is “01.001” No need to re-label the existing nodes, but different relationships, e.g. ancestor-descendant etc., can be determined, and the orders can be kept
ICDE'06Efficient Processing of Updates in XML33 Problem about CDBS The size of V-CDBS and F-CDBS may encounter the overflow problem when many nodes are inserted. To solve the overflow problem, we propose QED in [ Li & Ling CIKM05 ] QED uses four quaternary symbols, i.e. 0, 1, 2, and 3, and each is stored with 2 bits –0 is used as the separator or delimiter, and it will never encounter the overflow problem –QED is not as compact as CDBS, update cost is higher
ICDE'06Efficient Processing of Updates in XML34 (4) Experimental results Experimental setup Performance study on static XML Performance study on updates
ICDE'06Efficient Processing of Updates in XML35 Experimental setup All the schemes are implemented in Java and all the experiments are carried out on a 3.0 GHz Pentium 4 processor with 1 GB RAM running Windows XP Professional.
ICDE'06Efficient Processing of Updates in XML36 DatasetsTopics # of files Max/ave rage fan- out for a file Max/ave rage depth for a file Total # of nodes for each dataset D1Movie 49014/65/ D2Department 19233/814/ D3Actor 48037/115/ D4Company 24529/1355/ D5Shakespeare’s play 37434/486/ D6NASA /97/ The following table shows the datasets we used. Experimental setup (cont.)
ICDE'06Efficient Processing of Updates in XML37 Performance study on static XML Our V-CDBS and F-CDBS are the most compact variable and fixed length dynamic encoding Label sizes of different schemes
ICDE'06Efficient Processing of Updates in XML38 The 5 cases of node updates in experiments We select one XML file Hamlet in dataset D1 to test the update performance (it is similar for other XML files). Hamlet has 5 act elements. We test the following 5 cases –inserting an act element before act[1], –inserting an act element before act[2], –···, –and inserting an act element before act[5].
ICDE'06Efficient Processing of Updates in XML39 Labeling schemes Number of nodes to re-label (5 cases) Float-point-Containment00000 V-Binary-Containment F-Binary-Containment V-CDBS-Containment00000 F-CDBS-Containment00000 BinaryString-Prefix DeweyID(UTF8)-Prefix OrdPath1-Prefix00000 OrdPath2-Prefix00000 QED-Prefix00000 Prime Number of nodes to re-label in updates
ICDE'06Efficient Processing of Updates in XML40 Total time for node updates Several nodes inserted, main time is the I/O time, our approaches are the best to process updates. When considering processing time only, our approaches are much better, more than 300 times faster. More appropriate for updates with many nodes. Log2(Update time) of different schemes
ICDE'06Efficient Processing of Updates in XML41 Conclusion Our CDBS is dynamic Our CDBS is the most compact Update cost is the cheapest, only need to modify the last 1 bit of the neighbor label