Postgresql 为什么每个聚集最多平行工人!=最大平行工人数

Postgresql 为什么每个聚集最多平行工人!=最大平行工人数,postgresql,parallel-processing,Postgresql,Parallel Processing,我看到许多帖子和论文设定了以下价值观: max\u parallel\u workers-将数字设置为核心数 max\u parallel\u workers\u per\u gather-默认设置为2或设置为max\u parallel\u workers/2 使用并行查询时,benfit和速度改进基于max\u parallel\u workers\u per\u gather 为什么我找不到推荐设置max\u parallel\u workers\u per\u gather=max\u

我看到许多帖子和论文设定了以下价值观:


max\u parallel\u workers
-将数字设置为核心数

max\u parallel\u workers\u per\u gather
-默认设置为2或设置为
max\u parallel\u workers/2

使用并行查询时,benfit和速度改进基于
max\u parallel\u workers\u per\u gather

  • 为什么我找不到推荐设置
    max\u parallel\u workers\u per\u gather=max\u parallel\u workers
  • 如果我们设置
    max\u parallel\u workers\u per\u gather=max\u parallel\u workers
    会有什么陷阱

max\u parallel\u worker
定义了一个worker池。运行的每个查询都可以从该池中取出最多为每个聚集的
max\u parallel\u workers\u的工作人员

现在,如果使两个值相同,这意味着一个查询可能会使用所有可用的辅助对象,而同时运行的其他查询不能使用并行查询,即使它确实从中受益

如果一次从未运行多个语句,则可以将它们都设置为相同的值。但是,如果您有一个(繁忙的)系统,您希望有许多并发查询,并且希望多个查询能够从使用多个辅助程序中获益,那么最好将
max\u parallel\u workers\u per\u gather
保持在低于最大值的水平