/    /  DBMS – Multiple-Key Access

Multiple-Key Access

 Consider the following example.

“Find all faculty names in DNo = 5, with a salary equal to 50000 rupees.

  Select  FName

                  From  FACULTY

                  Where DNo = 5 and Salary = 50000;

 

There are three ways to do this:

 

  • Use the index on DNo to find all records pertaining to DNo = 5. Examine each such record to see whether salary = 50000.
  • Use the index on Salary to find all records pertaining to the salary which is equal to rupees 50000. Examine each such record to see whether it belongs to DNo = 5.
  • Use the index on Salary to find all records pertaining to the salary which is equal to rupees. 50000. Also, use the index on DNo attribute which is equal to 5. Take the intersection of these two indices, which gives the result.

 

 

Note: Here, there are many records pertaining to DNo = 5. Similarly, there are many records pertaining to Salary = 50000.

But, there will be few records pertaining to both DNo and Salary attributes.

 

Reference Link

Multiple-Key Access