Which statement is true regarding the execution of the query?

Examine the Exhibit1 to view the structure of an indexes for the EMPLOYEES table.

Examine the query:

SQL> SELECT * FROM employees WHERE employees_id IN (7876, 7900, 7902);
EMPLOYEE_ID is a primary key in the EMPLOYEES table that has 50000 rows.
Which statement is true regarding the execution of the query?

Examine the Exhibit1 to view the structure of an indexes for the EMPLOYEES table.

Examine the query:

SQL> SELECT * FROM employees WHERE employees_id IN (7876, 7900, 7902);
EMPLOYEE_ID is a primary key in the EMPLOYEES table that has 50000 rows.
Which statement is true regarding the execution of the query?

A.
The query uses an index skip scan on the EMP_EMP_ID_PK index to fetch the rows.

B.
The query uses the INLIST ITERATOR operator to iterate over the enumerated value list, and
values are evaluated using an index range scan on the EMP_EMP_ID_PK index.

C.
The query uses the INLIST ITERATOR operator to iterate over the enumerated value list, and
values are evaluated using a fast full index scan on the EMP_EMP_ID_PK index.

D.
The query uses the INLIST ITERATOR operator to iterate over the enumerated value list, and
values are evaluated using an index unique scan on the EMP_EMP_ID_PK index.

E.
The query uses a fast full index scan on the EMP_EMP_ID_PK index fetch the rows.

Explanation:
How the CBO Evaluates IN-List Iterators
The IN-list iterator is used when a query contains an IN clause with values. The execution plan is
identical to what would result for a statement with an equality clause instead of IN except for one
additional step. That extra step occurs when the IN-list iterator feeds the equality clause with
unique values from the IN-list.
Both of the statements in Example 2-1 and Example 2-1 are equivalent and produce the same
plan.
Example 2-1 IN-List Iterators Initial Statement
SELECT header_id, line_id, revenue_amount
FROM so_lines_all
WHERE header_id IN (1011,1012,1013);
SELECT header_id, line_id, revenue_amount
FROM so_lines_all
WHERE header_id = 1011
OR header_id = 1012
OR header_id = 1013;
Plan
————————————————-SELECT STATEMENT
INLIST ITERATOR

TABLE ACCESS BY INDEX ROWID SO_LINES_ALL
INDEX RANGE SCAN SO_LINES_N1
Reference: Database Performance Tuning Guide and Reference



Leave a Reply 2

Your email address will not be published. Required fields are marked *


vasya_pupkin

vasya_pupkin

I’d say D.
The query itself can be done in HR schema.
And execution plan for this query says that INDEX UNIQUE SCAN occurs on EMP_EMP_ID_PK

raka

raka

Agree with vasya

Answer is D