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.

122 CHAPTER 6. THE INDEX SELECTION PROBLEM<br />

Figure 6.7: Test 3: Long-running evaluation of the ISP tool that optimizes the<br />

database to a permanently changing workload.<br />

The pseudo code for this test scenario including the delta algorithm is presented<br />

below.<br />

1 /∗∗<br />

2 ∗ Pseudo code f o r scenario 3:<br />

3 ∗ This method creates , modifies and<br />

4 ∗ executes a workload continuously .<br />

5 ∗ The ISP Tool is called to optimize<br />

6 ∗ the workload ’ s execution time .<br />

7 ∗/<br />

9 int counter = 0;<br />

10 int ispFrequency = 30;<br />

11 double queryModifyRatio = 0.75;<br />

12 int workloadSize = 25;<br />

13 Workload w =<br />

14 createRandomWorkload ( workloadSize )<br />

16 while ( true ) {<br />

17 // create new database Operation<br />

18 Operation op = new Operation ( ) ;<br />

19 op . path = createRandomPathExpr ( ) ;<br />

20 op . type = getType ( queryModifyRatio ) ;<br />

22 // swap op with random op from w<br />

23 int index =<br />

24 ( int )random . nextDouble ( ) ∗workloadSize ;<br />

25 w[ index ] = op ;<br />

27 // execute and log the workload<br />

28 w. log ( ) ;<br />

29 w. execute ( ) ;<br />

31 // c a l l ISP t o o l each ispFreq ’ th run<br />

32 i f ( counter % ispFrequency == 0)<br />

33 ispTool . createSuitableIndexes (w) ;<br />

35 counter++;<br />

36 }

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

Saved successfully!

Ooh no, something went wrong!