In DB2, table space is an LDS which does not support index concept. But index is an back bone of DB2. How DB2 supports index? Explain?

Showing Answers 1 - 1 of 1 Answers

DB2 supports index with the help of leaf pages, non-leaf pages, and root pages.

Leaf pages - Contains indexed values followed by Record Identifiers (RIDs).

Non-leaf pages- Contains the upper range value of each of the leaf pages along with a pointer to each leaf page.

Root pages - Contains upper range values for each of the non-leaf pages with a pointer to the corresponding entry.

If we are searching for emp no 15001 in an employee table. The DB2 will search in root page to find out non-leaf page having entry greater than 15000. From the non-leaf page, it will search for the entry corresponding to emp no greater than 15000 and then in the leaf page, it will be pointed directly to the row in the table with emp no 15001.

Root page
NL1 10000
NL2 20000
NL3 30000

Non-Leaf page - NL2
LP1 - 11000
LP2 - 12000
LP3
LP4
LP5 - 15000
LP6 - 16000

Leaf page - LP6
15001 - the pointer

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