Scan Operation Hints

Function

These hints specify a scan operation, which can be tablescan, indexscan, or indexonlyscan.

Syntax

1
[no] tablescan|indexscan|indexonlyscan([@block_name] table [index])

Parameter Description

Example

To specify an index-based hint for a scan, create an index named i on the i_item_sk column of the item table.

1
create index i on item(i_item_sk);

Hint the query plan in Examples as follows:

1
2
explain
select /*+ indexscan(item i) */ i_product_name product_name ...

item is scanned based on an index. The optimized plan is as follows: