/*+ SOME_HINT */. Types of Hints
- Optimization goals and approaches
- Access path hints;
- In-memory column store hints;
- Join order hints;
- Join operation hints;
- Parallel execution hints;
- Online application upgrade hints;
- Query tranformation hints;
- XML hints;
- Other hints.
- Data warehousing hints;
- Optimizer hints
Oracle only lists two hints in this category:
ALL_ROWS and FIRST_ROWS( number_of_rows ).
Note
Oracle ignores
FIRST_ROWS in all DELETE and UPDATE statements and in SELECT statement blocks that include sorts and/or groupings, as it needs to fetch all relevant data anyway.Optimizer Hints
GATHER_PLAN_STATISTICS hint, which can be used to obtain statistics about the execution plan during the execution of a statement.
It is especially helpful when you intend to diagnose performance issues with a particular statementGATHER_OPTIMIZER_STATISTICS, which Oracle lists under ‘Other hints’.
It can be used to collect bulk-load statistics for CTAS statements and INSERT INTO ... SELECT statements that use a direct-path insert, which is accomplished with the APPEND hint, but more on that later.Access Path Hints
FULL( tab_name )
hint.
It instructs the optimizer to access a table by means of a full table
scan.
If the table you want Oracle to access with a full table scan has an
alias in the SQL statement, you have to use the alias rather than the
table name (without the schema name) as the parameter to FULLINDEX/NO_INDEXINDEX_ASC/INDEX_DESCINDEX_FFS/NO_INDEX_FFSINDEX_SS/NO_INDEX_SSINDEX_SS_ASC/INDEX_SS_DESCINDEX_COMBINE/INDEX_JOIN
Join Order Hints
ORDERED takes no parameters and instructs the optimizer to join the tables in the order as they appear in the FROM clause.
Because the ORDERED hint is so basic and you do not want to move around tables in the FROM clauseLEADING hint.
It takes the table names or aliases (if specified) as parameters, separated by spaces.ORDERED beats LEADING when both are specified for the same statementJoin Operation Hints
USE_HASH/NO_USE_HASHUSE_MERGE/NO_USE_MERGEUSE_NL/NO_USE_NL
All DML statements, including subqueries, can be run in parallel, which means that multiple blocks can be selected, inserted, deleted, or updated simultaneously. For parallelized DDL statements, multiple blocks are being created/altered and written in parallel. The DDL statements that can be run in parallel are:
CREATE INDEXCREATE TABLE ... AS SELECTALTER INDEX ... REBUILDALTER INDEX ... [ REBUILD | SPLIT ] PARTITIONALTER TABLE ... MOVEALTER TABLE ... [ MOVE | SPLIT | COALESCE ] PARTITION
FACT/NO_FACTMERGE/NO_MERGENO_EXPAND/USE_CONCATREWRITE/NO_REWRITEUNNEST/NO_UNNESTSTAR_TRANSFORMATION/NO_STAR_TRANSFORMATION
No comments:
Post a Comment