0

In this question Oracle: why doesn't use parallel execution?

and this Oracle documentation http://docs.oracle.com/cd/B10500_01/server.920/a96524/c20paral.htm#26156

They're comenting out a paralell statement like such:

SELECT /*+ PARALLEL(employees 4) PARALLEL(departments 4) USE_HASH(employees) 
ORDERED */
       MAX(salary), AVG(salary) 
FROM employees, departments
WHERE employees.department_id = departments.department_id 
GROUP BY employees.department_id; 

Why are they doing this?

Community
  • 1
  • 1
dwjohnston
  • 11,163
  • 32
  • 99
  • 194
  • 5
    They are not comments, they are hints, see `+` in `/*+`. Go through some documentations on 'Oracle Hints`. – San Jun 19 '14 at 02:35

1 Answers1

4

The Oracle 10 documentation is clearest on the syntax for hints:

Hint Syntax

You can send hints for a SQL statement to the optimizer by enclosing them in a comment within the statement.

The reason is simple. Hints are enclosed in a comment so if the SQL compiler doesn't recognize them, they just get ignored. This is true for different versions of Oracle. It is also true for code being ported to other databases. A hint can be included but the code still works.

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786