heterodb / pg-strom

PG-Strom - Master development repository
http://heterodb.github.io/pg-strom/
Other
1.27k stars 163 forks source link

[idea] full-aggregate pushdown under Gather #745

Open kaigai opened 3 months ago

kaigai commented 3 months ago

非常にパーティション数が多く、GROUP BYによってパーティションキーの一つ以上が指定されている場合。

Final Aggregate
 + Gather
    + Append
          + Partial Aggregate on Partition 1
          + Partial Aggregate on Partition 2
          + Partial Aggregate on Partition 3
                       :
          + Partial Aggregate on Partition N

こういった場合、AppendやGatherに加え、最後のFinal Aggregationの負荷も非常に大きい。

しかし、Partition 1を扱うプロセス(ワーカー)が一個だけである事を保証できれば、Final Aggregationは不要になる。 クエリの特性とパーティションキーの配置を考えて、こういった実行計画を作れるようにしたい。

Gather
 + Append
    + Aggregate on Partition 1
    + Aggregate on Partition 2
                :
    + Aggregate on Partition N

やる事

メリット