Oracle:为什么不使用并行执行? [英] Oracle: why doesn't use parallel execution?

查看:61
本文介绍了Oracle:为什么不使用并行执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看以下查询: 如果我注释子查询,它将使用并行执行,否则不会并行执行.

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

查询完成后

SELECT  /*+ parallel(c, 20) */
      1, (SELECT 2 FROM DUAL)
  FROM DUAL c;

推荐答案

您可能已经找到答案

只有在以下情况下,SELECT语句才能并行化 条件满足:

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

  • 查询包括并行提示规范(PARALLEL或 PARALLEL_INDEX)或查询中引用的架构对象具有 与它们关联的PARALLEL声明.

  • 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

SELECT列表中没有标量子查询.

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.

这篇关于Oracle:为什么不使用并行执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆