Table of Contents Previous Next


3 The SQL Language : 3.4 Optimizer Hints : 3.4.5 Global Hints

Thus far, hints have been applied directly to tables that are referenced in the SQL command. It is also possible to apply hints to tables that appear in a view when the view is referenced in the SQL command. The hint does not appear in the view, itself, but rather in the SQL command that references the view.
hint(view.table)
A view named, tx, is created from the three-table join of history, branches, and accounts shown in the final example of Section 3.4.3.
In addition to applying hints to tables within stored views, hints can be applied to tables within subqueries as illustrated by the following example. In this query on the sample application emp table, employees and their managers are listed by joining the emp table with a subquery of the emp table identified by the alias, b.
A hint can be applied to the emp table within the subquery to perform an index scan on index, emp_pk, instead of a table scan. Note the difference in the query plans.

3 The SQL Language : 3.4 Optimizer Hints : 3.4.5 Global Hints

Table of Contents Previous Next