Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

select * from weather where city = Edmonton and temp < - 3 0 Suppose B + - tree indexes are constructed on columns city

select * from weather where city = "Edmonton" and temp <-30
Suppose B+-tree indexes are constructed on columns city and temp. Data entries are stored in both indexes as (key,rid,pid) where rid is the record id of a data record with key value k and pid is the address of a page where the record with id rid is stored. Further assume 1% of the tuples satisfy the predicate "city='Edmonton'", 1% of the tuples satisfy the predicate "temp<-30" and 0.01% of the tuples satisfy both predicates.
a) What would be an efficient algorithm to evaluate the query if we know that the index on city is clustered?
b) What would be an efficient algorithm to evaluate the query if we know that none of the indexes are clustered?
c) Suppose each page of the index (leaf and non-leaf) stores up to 200 keys, and each data page stores up to 100 records. Assume both index and data pages are full. If N denotes the number of data records, estimate the number of page accesses for both algorithms given in (a) and (b).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions