30.08.2014 Views

url - Universität zu Lübeck

url - Universität zu Lübeck

url - Universität zu Lübeck

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

136 CHAPTER 7. THE XML INDEX UPDATE PROBLEM<br />

1. if (!intersection(linearize(p), linearize(p) ′ )) return false;<br />

2. NEG = getNegV ars(p) ∪ getNegV ars(p ′ );<br />

3. P OS = getP osV ars(p) ∪ getP osV ars(p ′ );<br />

4. NonT rivialV = NEG ∩ P OS;<br />

5. forEach permutation of vars ∈ NonT rivialV<br />

if (is satisfiable(p ∧ p ′ ,vars)) return true;<br />

6. return false;<br />

Figure 7.4: Pseudo code of the intersection algorithm for XIP NOT<br />

and checks their satisfiability. If we find no satisfying configuration the algorithm<br />

returns false because the expressions are mutually exclusive.<br />

The optimization steps lead to a substantial acceleration as we show in the next<br />

section. Anyhow, the algorithm still has an exponential complexity leading to<br />

exhaustive computations in general. In the context of real world’s XPath based<br />

database operations with a limited number of variables and qualifiers the satisfiability<br />

of path expressions can be decided in acceptable time: With an average case<br />

simulation (see next section) we determined an expected value of 155 milliseconds<br />

for testing the satisfiability of XPath expressions with 100 qualifiers and up to 150<br />

variables.<br />

7.4 Evaluation<br />

In this section we present performance measurements for the introduced algorithms<br />

that decide the intersection and satisfiability of two path expressions. The<br />

implementations were done in Java; the tests were performed on a Pentium 4 with<br />

2.66 GHz and 1 GB main memory.<br />

7.4.1 Evaluation of Intersection<br />

The first evaluation tests the intersection algorithm of figure 7.3 for path expressions<br />

p, p ′ ∈ XP {[],∗,//} . We increased the length of the path expressions p and p ′<br />

from 1 to 20; the location steps of the expressions were created randomly from<br />

a finite alphabet Σ. The time measurements include the parsing of the path expressions,<br />

the creation of the three automata and the analysis whether the final<br />

state is reachable. In order to obtain stable values we executed the algorithm<br />

some thousand times with path expressions of the same length. The measured<br />

total time is divided afterwards to get a stable average execution time for one run.<br />

As the diagram in figure 7.5 shows the execution time of the optimized algorithm<br />

increases almost linearly.<br />

The optimized algorithm that avoids the construction of the full product automaton<br />

has an average runtime of less than 1 millisecond for the largest path expression.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!