10 Gb databases can use more new optimizer hints to control optimization behavior. Now let's quickly parse these powerful new hints:
1. spread_min_analysis
With this hint, you can ignore the Compilation Time Optimization rules for workbooks such as detailed graph analysis. Other optimizations, such as creating filters to selectively locate the workbook access structure and restrict the revision rules, are available.
Because the number of rules is very large, the workbook analysis will be very long. This prompt helps us reduce the resulting compilation time by hundreds of hours.
Example:
SELECT /*+ SPREAD_MIN_ANALYSIS */ ... |
2. spread_no_analysis
With this hint, No workbook analysis is possible. Similarly, this hint can be used to ignore the revision rules and filter the generation. If a spreadsheet analysis exists, the Compilation Time can be minimized.
Example:
SELECT /*+ SPREAD_NO_ANALYSIS */ ... |
3. use_nl_with_index
This hint allows CBO to add a specific table to another original row through nested loops. A specific table is used as an internal table only in the following cases: if no label is specified, CBO must be able to use some labels, and at least one of these labels can be used as the index key value for judgment; otherwise, CBO must be able to add at least one tag as the index key value to the judgment.
Example:
SELECT /*+ USE_NL_WITH_INDEX (polrecpolrind) */ ... |
4. CARDINALITY
This hint defines the base number returned by the query or query. Note that if no table is defined, the base number is the total number of rows returned by the entire query.
Example:
SELECT /*+ CARDINALITY ( [tablespec] card ) */ |
5. selecti.pdf
This hint defines a selective evaluation of the query or query. If only one table is defined, the row part that satisfies all single table judgments in the defined table is optional. If a series of tables are defined, selectivity refers to the row section in the result after all tables that meet all available judgments in any order are merged.
Example:
SELECT /*+ SELECTIVITY ( [tablespec] sel ) */ |
However, note that if both hints CARDINALITY and SELECTIVITY are defined in the same batch of tables, both are ignored.
6. no_use_nl
Hint no_use_nl enables CBO to execute loop nesting. By using the specified table as an internal table, each specified table is connected to another original row. With this hint, only hash join and sort-merge joins are considered for the specified table.
Example:
SELECT /*+ NO_USE_NL ( employees ) */ ... |
7. no_use_merge
This hint allows CBO to reject sort-merge from adding each specified table to another original row by using the specified table as an internal table.
Example:
SELECT /*+ NO_USE_MERGE ( employees dept ) */ ... |
8. no_use_hash
This hint allows CBO to reject hash joins from adding each specified table to another original row by using the specified table as an internal table.
Example:
SELECT /*+ NO_USE_HASH ( employees dept ) */ ... |
9. no_index_ffs
This hint denies CBO from performing fast full-index scan on the specified tags in the specified table.
Syntax: /*+ NO_INDEX_FFS ( tablespecindexspec ) */ |
As the Oracle optimizer matures, Oracle will inevitably increase its reserves of tools for adjusting SQL statements.
Related Articles]
- Detailed functions of parsing Oracle database background processes
- Oracle remote replication and Remote Disaster Recovery classic Analysis
- How to import additional fields in Oracle as null values