heterodb/pg-strom

[idea] full-aggregate pushdown under Gather

Opened this issue · 0 comments

非常にパーティション数が多く、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

やる事

  • GpuPreAggのCPU-Fallback --> インフラストラクチャとして必要
  • この最適化を発動できないケースの整理

メリット

  • PostgreSQLが苦手な重複排除系のクエリで効果を発揮しやすいハズ