Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) (2 marks) Consider storing a relation R(x,y) in a grid file. Attribute x has a range of values from 0 to 100. Attribute y

a) (2 marks) Consider storing a relation R(x,y) in a grid file. Attribute x has a range of values from 0 to 100. Attribute y has a range of values from 200 to 700. The partitions for the grid file are uniformly spaced; for xthere are partitions every 5 units, at 5, 10, 15, and so on, while for y the partitions are every 50 units at 250, 300, 350, and so on. How many buckets do we have to examine to answer the range query:

 SELECT * FROM R WHERE 63 < x AND x < 92 AND 395 < y AND y < 625 

b) (3 marks) Suppose we store a relation R(x,y,z) in a partitioned hash table with 1024 buckets (i.e. 10-bit bucket addresses). Queries about R specify only attribute x half of the time. The remaining queries query either y or z with the queries split evenly between these attributes. Determine the average number of buckets that need to be searched to answer a query for the two following strategies. Also, answer which hash function best matches the types of queries expected.

The hash function produces 4 bits based only on x, 3 bits based only on y, and 3 bits based only on z.(1 mark)

The hash function produces 6 bits based only on x, 2 bits based only on y, and 2 bits based only on z.(1 mark)

Which strategy is better? (1 mark)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

What do you understand by Training and Development in HRM?

Answered: 1 week ago

Question

Does external information inuence the way we remember things?

Answered: 1 week ago

Question

outline some of the current issues facing HR managers

Answered: 1 week ago