The following figure shows how the database system searches for data in the B* tree for a SELECT statement.
The address table is defined by the column with the city primary key. The system searches in the table for an entry with the value Athens for the city primary key field.
1. The search begins at root level of the B* tree. The database system compares the Athens value with the value of the first entry in the root page, Ba.
2. As the value Athens is lower than Ba, the corresponding address information is evaluated. It points to a B* tree index page.
3. The search is continued at B* tree index level. The value Athens is greater than the first entry in the data page, An. The next entry in the page is evaluated. As the value Athens is lower than Au, the corresponding address information is evaluated. It points to a leaf page.
4. The search is continued at leaf level. A binary search algorithm is used in the position list. The corresponding address information for the table entry is evaluated with key value Athens.
5. The database system searches the data area in the leaf page until it finds the corresponding table entries. The search is then completed.