COMP9315 24T1 |
Exercises 06 Implementing Selection on Multiple Attributes (N-d) |
DBMS Implementation |
Consider a file of n=50000 tuples allocated across b=1024 pages using a multi-attribute hash function giving d=10 hash bits. The tuples in this file have four fields R(w,x,y,z) and a choice vector that allocates hash bits to fields as follows: dw=5, dx=2, dy=3, dz=0. Assuming that there are no overflow pages, compute how many pages each of the following queries would need to access:
Consider a file of r=819,200 Part records (C=100):
CREATE TABLE Parts ( id# number(10) primary key, name varchar(10), colour varchar(5) check value in ('red','blue','green'), onhand integer );
Used only via the following kinds of pmr queries:
Query Type | pQ |
---|---|
< id#, ?, ?, ? > | 0.25 |
< ?, name, colour, ? > | 0.50 |
< ?, ?, colour, ? > | 0.25 |
Give and justify values for d and the dis and suggest a suitable choice vector.
Consider the student relation:
Student(id:integer, name:string, address:string, age:integer, course:string, gpa:real);
with the following characteristics: r = 40,000, B = 1024, C = 20
If the relation is accessed via a superimposed codeword signature file with false match probability pF=10-4, compute the costs of answering the query:
select * from Student where course='BSc' and age=20;
for the following file organisations:
Use the following to compute signature properties:
Consider a multi-attribute hashed relation with the following properties:
Show the state of the data and overflow files after the insertion of the following tuples (in the order given):
(3,4,5) (2,4,6) (2,3,4) (3,5,6) (4,3,2) (2,6,5) (4,5,6) (1,2,3)