• 沒有找到結果。

Database  system  Assignment  5  Solution  1.        2.  Original  tree  (a)    (b)  4  page  read,  5  page  write

N/A
N/A
Protected

Academic year: 2022

Share "Database  system  Assignment  5  Solution  1.        2.  Original  tree  (a)    (b)  4  page  read,  5  page  write"

Copied!
7
0
0

加載中.... (立即查看全文)

全文

(1)

Database  system   Assignment  5  Solution   1.    

   

2.  Original  tree

  (a)  

  (b)  4  page  read,  5  page  write  

 

(2)

(c)  

  (d)  

  (e)  

  (f)  

   

(3)

3.Extendible Hashing Index

(a) Show the index after inserting an entry with hash value 68.

(b) Show the original index after inserting entries with hash values 17 and 69.

(4)

(c) Show the original index after deleting the entry with hash value 21. (Assume that the full deletion algorithm is used.)

(d) Show the original index after deleting the entry with hash value 10. Is a merge triggered by this deletion? If not, explain why. (Assume that the full deletion algorithm is used.)

The deletion of the data entry 10 which is the only data entry in bucket C doesn’t trigger a merge because bucket C is a primary page and it is left as a place holder. Right now, directory element 010 and its split image 110 already point to the same bucket C. We can’t do a further merge.

(5)

4. Linear Hashing Index

(a) Show the index after inserting an entry with hash value 4.

(b) Show the original index after inserting an entry with hash value 15.

(6)

(c) Show the original index after deleting the entries with hash value 36 and 44. (Assume that the full deletion algorithm is used.)

5. Answer the following question about Extendible Hashing:

(a) Supposed a Extendible Hashing has a global depth d and a bucket with local depth l. How many directory elements point to that bicket?

2^(d-l)

(b) When does the directory need to be double?

The directory is overflow and its local depth is equal to global depth.

(c) Does doubling the directory require us to examine all buckets with local depth equal to global depth?

No, only the splitting bucket requires to be examined.

(d) If the search key k is skewed (very nonuniform), why this situation is not a problem in practice?

Even if the distribution of search key is skewed, the choice of a good hashing function typically yields a fairly uniform distribution of hash values; skew is therefore not a problem in practice.

(e) Why do you use the least significant bits of the hash value to determine the directory slot of a data item?

The reason is that a directory can then be doubled simply by copying it.

(7)

6. Answer the following questions about Linear Hashing:

(a) For uniform distributions and skewed distributions of data, which situation has better performance in Linear Hashing and Extendible Hashing?

omitted

(b) How does Linear Hashing avoid a directory?

The new idea behind Linear Hashing is that a directory can be avoided by clever choice (i.e. round-robin splitting) of the bucket to split.

參考文獻

相關文件

(Correct formula but with wrong answer form: 1-point deduction for each error.) (Did not use unit vectors: 1-point deduction for each

So we check derivative of f and g, the small one would correspond to graph (b) and the other to (c)(i.e.. Moreover, f is

(We may assume that L is algebraic over K, or even to be the splitting field of B.) Especially, in number theory, we usually consider a number field which is a finite extension over

If the life time of the particle is a distribution with density (1/2)te − t , then the corresponding continuous time branching process is not Markovian.7. Chapter 4: Second

2) A 900 g sample of pure water is shaken with air under a pressure of 0.95 atm at 20 °C. The vapor pressures of the pure compounds at 25°C are 331 mm Hg for cyclopentane and 113 mm

The molal-freezing-point-depression constant (Kf) for ethanol is 1.99 °C/m. The density of the resulting solution is 0.974 g/mL.. 21) Which one of the following graphs shows the

B) They are cyclic compounds in which carbon ring is connected to another ring not containing carbon atoms C) They are cyclic compounds that can have more than one stable

17) Consider a cell made up of two half cells consisting of the same metal in solutions of the metal ion of different concentrations.. A piece of the coffin is analyzed by