Oracle之hint介绍

CREATE  VIEW stock_item
     AS
     SELECT /*+ leading(s) use_merge(i) */
     i_price, i_name, i_data, s_i_id, s_w_id, s_order_cnt, s_ytd, s_remote_cnt, s_quantity, s_data, s_dist_01, s_dist_02, s_dist_03, s_dist_04, s_dist_05, s_dist_06, s_dist_07, s_dist_08, s_dist_09, s_dist_10
     FROM stok s, item i
     WHERE s.s_i_id = i.i_id;
Query OK, 0 rows affected (0.01 sec)


提示(Hint)  USE
/*+ ALL_ROWS */  选择cost-based optimizer里总响应时间最短的计划(DW) 
/*+ FIRST_ROWS */  选择cost-based optimizer里最快得出第一行的计划(OLTP)--Nested Loop Join
/*+ RULE */  以rule-based optimization制作计划
/*+ FULL(table) */  不管有无index,选择full table scan
/*+ HASH_AJ(table) */   将NOT IN subQuery变化为hash antijoin
/*+ INDEX(table index) */   将特定表的特定索引正向使用
/*+ INDEX_DESC(table index) */  将特定表的特定索引逆向使用
/*+ INDEX_FFS(table index) */   只用索引构成的sql 上,使用fast full index scan 
/*+ ORD

你可能感兴趣的:(Oracle,oracle,数据库)