Answered step by step
Verified Expert Solution
Link Copied!

Question

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 to Expert-Tailored 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

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

Students also viewed these Databases questions

Question

Which form of proof do you find most persuasive? Why?

Answered: 1 week ago