Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Other Syntax Segments > Optimizer Directives >

Join-Order Directive

Use the ORDERED join-order directive to force the optimizer to join tables or views in the order in which they appear in the FROM clause of the query.

Read syntax diagramSkip visual syntax diagramJoin-Order Directive:
 
|--ORDERED--+----------+----------------------------------------|
            '-comments-'
 

Element Description Restrictions Syntax
comments Text to document the directive Must appear between comment symbols Character string

For example, the following query forces the database server to join the dept and job tables and then join the result with the emp table:

SELECT --+ ORDERED
   name, title, salary, dname
FROM dept, job, emp WHERE title = 'clerk' AND loc = 'Palo Alto' 
   AND emp.dno = dept.dno 
   AND emp.job= job.job;

Because no predicates occur between the dept table and the job table, this query forces the database server to construct a Cartesian product.

When your query involves a view, the placement of the ORDERED join-order directive determines whether you are specifying a partial- or total-join order.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]