Oracle: why doesn't use parallel execution?

后端 未结 2 755
失恋的感觉
失恋的感觉 2021-01-15 00:21

Look at the following query: If I comment the subquery it uses parallel execution otherwise it doesn\'t.

After the query has been

SELECT  /*+ parall         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-15 01:18

    You could have found the answer in the documentation:

    A SELECT statement can be parallelized only if the following conditions are satisfied:

    • The query includes a parallel hint specification (PARALLEL or PARALLEL_INDEX) or the schema objects referred to in the query have a PARALLEL declaration associated with them.

    • At least one of the tables specified in the query requires one of the following:

      • A full table scan

      • An index range scan spanning multiple partitions

    • No scalar subqueries are in the SELECT list.

    Your query falls at the final hurdle: it has a scalar subquery in its projection. If you want to parallelize the query you need to find another way to write it.

提交回复
热议问题