B. How many rows fit in a data block? You must consider: average size of a row (from Question 2 / part 1A) • 20 byte ove
Posted: Fri Jul 01, 2022 5:41 am
Question 2 / part 1A) • 20 byte overhead in the data block two bytes for each entry in the offset array per row in the data block Rows per data block= Question 4 Number of data blocks =
Consider a Vehinterest table that contains the following attributes: custNr vehType 5 character type of vehicle (e.g., TRUCK, SUV, VAN, ). When combined with custNr and vehMake, this is the unique key for this table. 12 character make of vehicle (e.g., 4Runner, Explorer, Prius, Connect). When combined with custNr and vehType, this is the unique key for this table. ageRangeCd customer's age range (e.g., 1:under 20, 2:20-29, 3:30-39, 4:40-49, 5:50-59, 6:60-69, 7:over 70), this is 1 8 character customer number. When combined with vehType and vehMake, it is the unique key for Vehinterest. vehMake byte lastActivityDt 4 byte date representing the last activity for this row email customer's email, max of 250 character, average of 36 characters streetAddress customer's street address, max of 150 characters. This average is 40 characters. Assumptions: 1. There are 10 million rows in the Vehinterest Table. Because there are multiple rows for a customer (due to different combinations of custNr), on the average, there are 5 rows for each customer; therefore, there are 2 million customers. 2. Data and index blocks are 4096 bytes. 4. 3. An index entry for a B+Tree contains: the key (size depends on the contents) and a Row Id which is 4 bytes. There are two variable-sized attributes (email and streetAddress). Each will use a one byte length. Near the beginning of the row, there will be an additional 2 byte offset to access the streetAddress that follows the email. 5. Assume there are 200,000 customers in ageRangeCd=5. 10% of those customers are interested in SUVs. 6. Every character in Java uses 2 bytes.
B. How many rows fit in a data block? You must consider: average size of a row (from Consider a Vehinterest table that contains the following attributes: custNr vehType 5 character type of vehicle (e.g., TRUCK, SUV, VAN, ). When combined with custNr and vehMake, this is the unique key for this table. 12 character make of vehicle (e.g., 4Runner, Explorer, Prius, Connect). When combined with custNr and vehType, this is the unique key for this table. ageRangeCd customer's age range (e.g., 1:under 20, 2:20-29, 3:30-39, 4:40-49, 5:50-59, 6:60-69, 7:over 70), this is 1 8 character customer number. When combined with vehType and vehMake, it is the unique key for Vehinterest. vehMake byte lastActivityDt 4 byte date representing the last activity for this row email customer's email, max of 250 character, average of 36 characters streetAddress customer's street address, max of 150 characters. This average is 40 characters. Assumptions: 1. There are 10 million rows in the Vehinterest Table. Because there are multiple rows for a customer (due to different combinations of custNr), on the average, there are 5 rows for each customer; therefore, there are 2 million customers. 2. Data and index blocks are 4096 bytes. 4. 3. An index entry for a B+Tree contains: the key (size depends on the contents) and a Row Id which is 4 bytes. There are two variable-sized attributes (email and streetAddress). Each will use a one byte length. Near the beginning of the row, there will be an additional 2 byte offset to access the streetAddress that follows the email. 5. Assume there are 200,000 customers in ageRangeCd=5. 10% of those customers are interested in SUVs. 6. Every character in Java uses 2 bytes.