Calculate the cardinality and minimum cost for each of the following Projection operations:
? a hash index with no overflow on the primary key attributes, roomNo/hotelNo in Room;
? a clustering index on the foreign key attribute hotelNo in Room;
? a B + -tree index on the price attribute in Room;
? a secondary index on the attribute type in Room.
nTuples(Room) = 10000 bFactor(Room) = 200
nTuples(Hotel) = 50 bFactor(Hotel) = 40
nTuples(Booking) = 100000 bFactor(Booking) = 60
nDistinct hotelNo (Room) = 50
nDistinct type (Room) = 10
nDistinct price (Room) = 500
min price (Room) = 200 max price (Room) = 50
nLevels hotelNo (I) = 2
nLevels type (I) = 2
nLevels price (I) = 2 nLfBlocks price (I) = 50
P1: ? hotelNo (Hotel)
P2: ? hotelNo (Room)
P3: ? price (Room)
P4: ? type (Room)
P5: ? hotelNo, price (Room)
P1: ? hotelNo (Hotel)
Duplicate elimination using sorting: 4
Duplicate elimination using hashing: 4 (cardinality of result stays same
because hotelNo is key attribute)
P2: ? hotelNo (Room)
Duplicate elimination using sorting: 350
Duplicate elimination using hashing: 51 (cardinality of result estimated as
SC hotelNo (Room) = 200, occupying 1
block)
P3: ? price (Room)
Duplicate elimination using sorting: 350
Duplicate elimination using hashing: 51 (cardinality of result estimated as
SC price (Room) = 20, occupying 1 block)
P4: ? type (Room)
Duplicate elimination using sorting: 350
Duplicate elimination using hashing: 55 (cardinality of result estimated as
SC hotelNo (Room) = 1000, occupying 5
blocks)
P5: ? hotelNo, price (Room)
Duplicate elimination using sorting: 350
Duplicate elimination using hashing: 51 (cannot be any more than cost of P2,P3)
You might also like to view...
When NetBeans runs a program, the flow of execution begins in the ____ method.
A. main() B. start() C. execute() D. begin()
A loop that continues to execute endlessly is called an endless loop.
Answer the following statement true (T) or false (F)
Which of the following technology package licenses is needed for performance routing and services like WAAS and NBAR2?
A) IP Base B) Application Experience C) Unified Communications D) Security
What technique does the function use to refer to array elements?
Consider the following function: void reverse(char *string1, const char *string2) { int stringsize{sizeof(string1)/sizeof(char)}; *(string1 + stringsize – 1) = '\0'; string1 = string1 + stringsize – 2; for (; *string2 != '\0'; string1--, string2++) { *string1 = *string2; } }