Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following query in the context of mini - project 2 . r:great p:camera Suppose the full reviews are stored in file reviews.txt; further

Consider the following query in the context of mini-project 2. r:great p:camera
Suppose the full reviews are stored in file reviews.txt; further assume the review terms
(rterms) are organized as a B+ tree and the product terms (pterms) are organized as a sorted file. The index entries for both rterms and pterms are in the form of (term,reviewid,pid) where pid is the address of the page in reviews.txt where the full record of the respective review is stored.
Suppose each page of both the B+ tree index and the sorted file stores 100 index entries, whereas each page of the file reviews.txt stores 50 records. Suppose 5% of the review records satisfy the predicate r:great, 2% of the records satisfy the predicate p:camera and 1% of the records satisfy both predicates. Let N denotes the number of records in reviews.txt,20N denotes the number of index entries in rterms and 3N denotes the number of index entries in pterms.
a)[4 marks ] What is the cost (in terms of the number of I/Os) of evaluating the query if the query predicates r:great and p:camera are respectively evaluated using the B+ tree index and the sorted file, before retrieving the matching records from reviews.txt? Assume both the B+ tree and the sorted file are unclustered. Show your work.

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

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

More Books

Students also viewed these Databases questions

Question

f. Did they change their names? For what reasons?

Answered: 1 week ago