Docsity

Homework 5 with Solution - Database Systems | CS 430, Assignments of Deductive Database Systems

Toggle sidebar
bg1
Homework 5 Solution
April 7, 2009
Q1: Multilevel Index 20 points
1. 1st level index requires d50,000/30e=1667 blocks.
2. 2nd level index requires d1667/30e=56 blocks.
3. 3rd level index requires d56/30e=2 blocks.
4. 4th level index requires 1 block which has only 2 entries.
Q2: Extendible hashed file a) b) c)
•Q2.a) 15 points
0001
0011
2
3
0101
0101
2
1001
1000
2
1111
1111
3
1101
3
000
001
010
011
100
101
110
111
Figure 1: Q2.a
1
pf3

Partial preview of the text

Download Homework 5 with Solution - Database Systems | CS 430 and more Assignments Deductive Database Systems in PDF only on Docsity!

Homework 5 Solution

April 7, 2009

Q1: Multilevel Index 20 points

  1. 1st level index requires d 50 , 000 / 30 e = 1667 blocks.
  2. 2nd level index requires d 1667 / 30 e = 56 blocks.
  3. 3rd level index requires d 56 / 30 e = 2 blocks.
  4. 4th level index requires 1 block which has only 2 entries.

Q2: Extendible hashed file a) b) c)

  • Q2.a) 15 points

0001 0011

2

3

0101 0101

2

1001 1000

2

1111 1111

3

1101

3

000

001

010

011

100

101

110 111

Figure 1: Q2.a

  • Q2.b) 5 points No. Each time you double the directory, the pointer always points to the corre- sponding data.
  • Q2.c) 20 points

0001 0011

2

2

0101 0101

2

1001 1000

2

1111 1111

2

00

01

10

11

Figure 2: Q2.c

Q3: Directory size 20 points There are dN/Be buckets. The directory size will be minimum if 2d^ = dN/Be. Solv- ing for d, we get d = dlog 2 dN/Bee. So the smallest possible directory size is 2dlog^2 dN/Bee. Q4: B+ Tree 20 points