14.02.2014 Views

Query Processing and Optimization

Query Processing and Optimization

Query Processing and Optimization

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.

Example of Sort-Merge Join<br />

• Cost to sort CheckedOut (b CheckedOut = 10)<br />

• Cost Sort ChecedOut = 2 × 2.000 + 2 × 2.000 × ⎡log 5 (2.000/6)⎤ = 20.000<br />

• Cost to sort Customer relation (b Customer = 10)<br />

• Cost Sort Customer = 2 × 10 + 2 × 10 × ⎡log 5 (10/6)⎤ = 40<br />

• Cost for merge join<br />

• Cost to scan sorted Customer + cost to scan sorted CheckedOut<br />

• Cost merge join = 10 + 2.000 = 2.010<br />

• Cost sort-merge join = Cost Sort Customer + Cost Sort ChecedOut + Cost merge join<br />

• Cost sort-merge join = 20.000 + 40 + 2.010 = 22.050<br />

19

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

Saved successfully!

Ooh no, something went wrong!