Oracle Database - Hints

> Database > Oracle Database

1 - About

You can use hints to alter the execution path chosen by the cost-based optimizer. Hints are embedded within SQL statements, and only modify the execution path for the statements in which they appear. A hint follows a SELECT, INSERT, UPDATE, or DELETE keyword in the respective statements. The following string indicates the start of a hint:

/*+

The following string indicates the end of a hint:

*/

The syntax for hints is almost identical to that of comments within SQL. The only difference is the addition of the + sign to indicate the start of the hint. The + cannot be preceded by a space.

When a hint is specified incorrectly, the optimizer ignores it and does not report an error. Many of the hints allow you to list specific table names. When you use table aliases in your query, refer to the tables by their aliases within the hints.

Advertising

3 - DRIVING_SITE

A distributed DML statement must execute on the database where the DML target resides. The DRIVING_SITE hint cannot override this.

4 - Metadata

SELECT * FROM v$sql_hint

5 - Documentation / Reference

db/oracle/hints.txt · Last modified: 2017/09/06 19:28 by gerardnico