5.4.2 Evaluation method when range indexes are used
When range indexes are used, the search conditions are evaluated according to the following two range index conditions:
-
Condition in which range indexes are used to skip chunks
This condition uses range indexes to skip chunks that do not contain data that satisfies the search condition. Because this condition reduces the number of chunks to be accessed, the amount of data pages to be referenced is reduced and search performance improves.
This condition is used only for range indexes that can be used to skip chunks.
To determine whether a range index can be used to skip chunks, see When checking whether the index is a range index that can skip chunks in Searching a dictionary table in the HADB Setup and Operation Guide.
-
Condition in which range indexes are used to skip segments
This condition uses range indexes to skip segments that do not contain data that satisfies the search condition. Because this condition reduces the number of segments to be accessed, the amount of data pages to be referenced is reduced and search performance improves.
- Note
-
For details about skipping chunks and segments, see Range indexes in the HADB Setup and Operation Guide.
- Organization of this subsection
(1) Example of skipping chunks by using range indexes
The following provides an example of skipping chunks by using range indexes.
- Explanation:
-
The following describes the procedure for retrieval processing.
-
Before accessing chunks, HADB evaluates the range index condition used to skip chunks.
-
Range index condition used to skip chunks: 100≤C1≤300, C2 IN(1, 2), C3<300
-
-
HADB evaluates the search condition and key condition based on the B-tree indexes of the search target chunks.
-
Search condition: 100≤C1≤300
-
Key condition: C2 IN(1,2)
-
-
HADB accesses the data page and evaluates the remaining search condition.
-
Search condition to be evaluated after the data page is accessed: C3<300
-
Note that range indexes defined in columns C1, C2, and C3 are not used to skip a segment.
-
(2) Example of skipping segments by using range indexes
The following provides an example of skipping segments by using range indexes.
- Explanation:
-
The following describes the procedure for retrieval processing.
-
Before accessing chunks, HADB evaluates the range index condition used to skip chunks.
-
Range index condition used to skip chunks: 100≤C1≤110
-
-
HADB evaluates the range index condition used to skip segments in the search target chunk.
-
Range index condition used to skip segments: 100≤C1≤110
-
-
HADB accesses the data page and evaluates the search condition.
-
Search condition to be evaluated after the data page is accessed: C2 IN(1,2)
-
-