Postgresql 中文操作指南

15.2. When Can Parallel Query Be Used? #

有几种设置可能导致查询计划程序在任何情况下都不会生成并行查询计划。为了生成任何并行查询计划,必须按如下所示配置下列设置。

There are several settings that can cause the query planner not to generate a parallel query plan under any circumstances. In order for any parallel query plans whatsoever to be generated, the following settings must be configured as indicated.

此外,系统不得在单用户模式下运行。由于在这种情况下整个数据库系统作为单个进程运行,因此不会有后台工作程序可用。

In addition, the system must not be running in single-user mode. Since the entire database system is running as a single process in this situation, no background workers will be available.

即使通常可以生成并行查询计划,如果以下任一情况为真,计划程序也不会为给定查询生成它们:

Even when it is in general possible for parallel query plans to be generated, the planner will not generate them for a given query if any of the following are true:

即使为特定查询生成了并行查询计划,也有几种情况下,在执行时无法并行执行该计划。如果发生这种情况,领导者将自行完全执行位于 Gather 节点下方的计划部分,几乎就像 Gather 节点不存在一样。如果满足以下任一条件,就会发生这种情况:

Even when parallel query plan is generated for a particular query, there are several circumstances under which it will be impossible to execute that plan in parallel at execution time. If this occurs, the leader will execute the portion of the plan below the Gather node entirely by itself, almost as if the Gather node were not present. This will happen if any of the following conditions are met: