![](https://csdnimg.cn/release/download_crawler_static/86291233/bg1.jpg)
C H A P T E R
15
Query Proessing
Solutions for the Pratie Exerises of Chapter 15
Pratie Exerises
15.1
Answer:
We will refer to the tuples (kangaroo, 17) through (baboon, 12) using tuple
numbers
t
1
through
t
12
. We refer to the
j
th
r un used by the
i
th
pass, as
r
ij
. The
initial sorted runs have three bloks eah. They are:
r
11
= ^
t
3
,
t
1
,
t
2
`
r
12
= ^
t
6
,
t
5
,
t
4
`
r
13
= ^
t
9
,
t
7
,
t
8
`
r
14
= ^
t
12
,
t
11
,
t
10
`
Eah pass merges three r uns. Therefore t he r uns after the end of the rst pass
are:
r
21
= ^
t
3
,
t
1
,
t
6
,
t
9
,
t
5
,
t
2
,
t
7
,
t
4
,
t
8
`
r
22
= ^
t
12
,
t
11
,
t
10
`
At t he end of the seond pass, the tuples are ompletely sor ted into one r un:
r
31
= ^
t
12
,
t
3
,
t
11
,
t
10
,
t
1
,
t
6
,
t
9
,
t
5
,
t
2
,
t
7
,
t
4
,
t
8
`
91
评论0