The Oracle execution plan has 5 types of index scans, depending on the type of the index and the where constraints, namely, index unique scans (the index unique scan), index range scans (the index range Scan), index full scan Scan), Indexing Quick Scan (index fast full scan) index skip-Scan (index skip scan).
1, the index unique Scan (index unique scan)
Finding a value through a unique index often returns a single rowid. Oracle often implements a unique scan if there is a unique or primary KEY constraint, which guarantees that the statement only accesses a single line.
Examples of using uniqueness constraints:
Explain plan for SELECT * from EMP where EMPNO = 7369;
(2) Index range Scan (index range scan)
Using an index to access multiple rows of data, the typical case of using an index range scan on a unique index is to use the scope operators (such as >, <, <>, >=, <=, between) in the predicate (where constraints).
Examples of using index range scans:
Explain plan for SELECT * from EMP where empno>7368;
3 cases of using the index rang scan:
(a) The range operator is used on a unique indexed column (> < <> >= <= between)
(b) On a composite index, queries are made using only a subset of the columns, causing multiple rows to be queried
(c) Any queries made on a non-unique indexed column.
(3) Index full scan (scan)
corresponding to the full table scan, there is also a corresponding full index scan. And the data that is queried at this time must be obtained directly from the index.
Examples of full index scans:
Explain plan for select empno from EMP;
(4) Index fast Scan (index fast full scan)
Scanning all blocks of data in an index is similar to the index full scan, but one notable difference is that it does not sort the data that is queried, that is, the data is not returned in a sort order. In this access method, you can use the multiple-block read function, or you can use parallel read to achieve maximum throughput and shorten execution time. Occurs often without an order by.
An example of an index quick scan (the amount of data in the EMP1 table is 1 million):
Explain plan for select empno from EMP1;
(5) Indexing Jump Scan (index skip scan)
The index skip scan may be executed when a query can get results from a combined index, with few results, and where the index boot column is not included in the Where condition.
Index Jump scan Occurrence condition:
1. Must be a combined index.
2. The boot column does not appear in the Where condition
Example of an index jump scan (the amount of data in the EMP1 table is 1 million, and the combined index is empno and ename fields)
Explain plan for SELECT * from EMP1 where ename = ' SMITH ';