Question: [ 4 0 % ] Consider the following SQL that creates a table R with 2 columns and 2 indexes ( a primary key on
Consider the following SQL that creates a table with columns and indexes a
primary key on A a secondary Btree index on B
CREATE TABLE R
A INT NOT NULL PRIMARY KEY,
B INT NOT NULL,
C VARCHAR
INDEX B USING BTREE,
INDEX C USING HASH ;
Assume the following storage parameters:
i There are records in stored using fixedlength record arrangement, and
sequential file organization wrt the column A there are no overflow blocks.
ii Records are stored on a disk with sector size of bytes and a block spans sectors
Each block contains a header which occupies bytes.
iii The size of a CHAR is byte, an INT is bytes, and the size of a pointer is bytes.
a What is the size of in excluding the indices?
b Please estimate the number of disk block accesses are required to answer the following SQL
with the use of the Btree secondary index on B You can assume that the SQL returns
matching records. Please explain your answer and list your assumptions.
SELECT FROM WHERE AND ;
c Suppose there are two other tables and :
Give an optimized relational algebra expression tree for the following query by considering
the use of indices, justify your answer with some explanations. You can assume that:
S has records, average value in SE is with standard deviation of
T has records, average value in TG is with standard deviation of
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
