5.1.1 About table scans
A table scan is a base table retrieval method that does not use B-tree indexes and text indexes. A table scan is used in the following cases:
-
No B-tree index or text index is defined for the table.
-
No search condition is specified that can effectively use a B-tree index or text index.
-
WITHOUT INDEX is specified in the index specification.
The following figure shows an example of a table scan.
- Explanation:
-
Because column C3 specified in the search conditions is not an indexed column, B-tree index IDX_C1C2 is not used when the SELECT statement shown above is executed. Therefore, HADB performs a table scan and accesses all rows in the data pages.
If range indexes are defined for the table, the range indexes might also be used.
- Note
-
If you have specified in the index specification that B-tree indexes or text indexes are not to be used, HADB uses a table scan.
- Important
-
If a table scan is to be performed, we recommend that you define range indexes for the table. Using range indexes might improve performance. For details about the conditions under which range indexes are used, see 5.3 Range indexes used during execution of SQL statements.