gpt4 book ai didi

sql - Oracle:为什么不使用并行执行?

转载 作者:行者123 更新时间:2023-12-02 07:42:26 25 4
gpt4 key购买 nike

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

查询得到后

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

最佳答案

您本可以找到答案 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.

您的查询处于最后一个障碍:它的投影中有一个标量子查询。如果你想并行化查询,你需要找到另一种方式来编写它。

关于sql - Oracle:为什么不使用并行执行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9724025/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com