Program efficiency

This question has to do with program efficiency, where we will define it to be:

‘Physically reading the least number of records required to produce the desired report.’

The report we must produce will have the following user-entered parameters, all of which are required:

1) Date Range
2) COUNTRY (a single value)
3) BRANCH (a single value)
4) PRODUCT (a single value)

All of the data for the report can be found in TABLE1 depicted in the diagram, which has 1,000,000 records. The user-entered date range will be applied to the field, SERVICEDATE.

To read the records that meet our user-entered parameters, we can choose to read using INDEX1 or INDEX2.

BRANCH values are not unique. They must be qualified by COUNTRY to make them unique. The total number of unique BRANCHES, i.e. qualified by COUNTRY, is 2,580. For the purposes of this analysis, the data can be assumed to be evenly distributed among these 2,580 unique BRANCHES.

PRODUCTS are unique, and though there are 999 possible values (zero is invalid), the actual distribution of data is among only 800 values. The other 199 ‘possible’ values are not represented, i.e. there is no data for these 199 PRODUCT values. Among the 800 actively used products, the data is evenly distributed for the purposes of this analysis.

So, given our definition of efficiency and the above information, which index will prove most efficient if this is primarily a US-use report (i.e., one where users will mostly be entering COUNTRY = US)? Explain your decision via calculations.

Remember, our objective is to choose the index that will minimize the number of records physically read. Not all required parameters can be applied via the single index chosen. This means that some of the parameters will have to be satisfied after we have physically read the records via the chosen index. How or how many records we process after we physically read the records via our chosen index is not important to this analysis.

Showing Answers 1 - 3 of 3 Answers

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions