Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Suppose that the DEPARTMENT relation DEPARTMENT (dnumber, dname, mgr_ssn, start_date) has 1000 record stored in 200 blocks. The DEPARTMENT has: a clustering index on dnumber

image text in transcribed

Suppose that the DEPARTMENT relation DEPARTMENT (dnumber, dname, mgr_ssn, start_date) has 1000 record stored in 200 blocks. The DEPARTMENT has: a clustering index on dnumber with 4 levels with the number of blocks in the first level is 50. A hash index on dnumber with a hash function f(x)=x mod 10 A secondary index on dnumber with 4 levels with the number of blocks in the first level is 50. Analyze the cost that the optimizer will compute, and determine which cost is the most efficient: 1. odno>5 (DEPARTMENT) 2. odno=1 (DEPARTMENT) 1 S1: Linear search Csa=b, For equality condition on a key attribute, C516= S2: Binary search Cs2=log2b+bx]-1, Reduces to logzb if equality condition is on a key attribute 1 S3a: Using a primary index to retrieve a single record Cs3a = x + 1 S3b: Using a hash key to retrieve a single record Cs36 = 1 I S4: Using an ordering index to retrieve multiple records Cs4 = x + b bfr - b 2 - S5: Using a clustering index to retrieve multiple records Cs5 = x + 1 = S6: Using a secondary (B+ tree) index Cs6a = x + 1 +5 (worst case) CS66 = x + + box + (for range queries) 2 + 2 Suppose that the DEPARTMENT relation DEPARTMENT (dnumber, dname, mgr_ssn, start_date) has 1000 record stored in 200 blocks. The DEPARTMENT has: a clustering index on dnumber with 4 levels with the number of blocks in the first level is 50. A hash index on dnumber with a hash function f(x)=x mod 10 A secondary index on dnumber with 4 levels with the number of blocks in the first level is 50. Analyze the cost that the optimizer will compute, and determine which cost is the most efficient: 1. odno>5 (DEPARTMENT) 2. odno=1 (DEPARTMENT) 1 S1: Linear search Csa=b, For equality condition on a key attribute, C516= S2: Binary search Cs2=log2b+bx]-1, Reduces to logzb if equality condition is on a key attribute 1 S3a: Using a primary index to retrieve a single record Cs3a = x + 1 S3b: Using a hash key to retrieve a single record Cs36 = 1 I S4: Using an ordering index to retrieve multiple records Cs4 = x + b bfr - b 2 - S5: Using a clustering index to retrieve multiple records Cs5 = x + 1 = S6: Using a secondary (B+ tree) index Cs6a = x + 1 +5 (worst case) CS66 = x + + box + (for range queries) 2 + 2

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students explore these related Databases questions