Hitachi

Hitachi Advanced Database Application Development Guide


5.4.1 Evaluation method when B-tree indexes are used

When B-tree indexes are used, the search conditions are evaluated according to the range search condition and the key condition.

Organization of this subsection

(1) About the range search condition

A condition for specifying a search range when B-tree indexes are used is called a range search condition. This includes mainly the following conditions:

The following figure shows an example of the evaluation method based on a range search condition.

Figure 5‒4: Example of evaluation method based on a range search condition

[Figure]

Explanation:

In this example, the range search condition is 50 ≤ C1 ≤ 100. HADB accesses the data pages that contain the rows that satisfy the range search condition.

(2) About the key condition

A condition that can be evaluated only by B-tree-indexed columns is called a key condition. A key condition cannot be used to narrow down the search range when B-tree indexes are used, as a range search condition can do. However, a key condition can reduce the number of times a data page is referenced because the key condition can be evaluated by using only B-tree index pages, thereby improving search performance.

The following figure shows an example of the evaluation method based on a key condition.

Figure 5‒5: Example of evaluation method based on a key condition

[Figure]

Explanation:

In this example, the conditions are as follows:

  • Range search condition: 40 ≤ C1 ≤ 60

  • Key condition: C2 IN(1,2)

HADB uses the range search condition to narrow down the search range and accesses only those data pages that contain the rows that satisfy the key condition.