alter session set optimizer_mode=first_rows : OPTIMIZER_MODE « SQL PLUS Session Environment « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL>
SQL> create table myTable
  2  as
  3  select rownum id, a.*
  4    from all_objects a
  5   where 1=0
  6  /
SQL>
SQL>
SQL>
SQL> alter session set optimizer_mode=first_rows;
SQL>
SQL> select t1.object_name, t2.object_name
  2    from myTable t1, myTable t2
  3   where t1.object_id = t2.object_id
  4     and t1.owner = 'WMSYS'
  5  /
SQL> alter session set sql_trace=true;
SQL> drop table myTable;








29.23.OPTIMIZER_MODE
29.23.1.alter session set OPTIMIZER_MODE = choose
29.23.2.alter session set optimizer_index_cost_adj, alter session set optimizer_index_caching
29.23.3.alter session set optimizer_max_permutations=80000
29.23.4.alter session set optimizer_mode=all_rows
29.23.5.alter session set optimizer_mode=first_rows