Greenplum データベースがあり、そこには 10 個のハードディスクを反映する 10 個のセグメントがあります。私のテーブルは、日付に基づくプライマリ パーティションと、ハッシュ ID に基づくセカンダリ パーティションに分割されています。したがって、1 か月間は 30 のプライマリ パーティションがあり、各パーティションには 100 のサブ パーティションが含まれます。サブパーティション内のデータは、ハッシュ ID に基づいてロードされます。問題は、これらのパーティションがセグメント間でどのように分散されるかです。
推測1:
seg1(equally distributed based on pri partition : 30datepartition/10=3 date partitions)
date1---0-99 sub partition of hashid
date2---0-99 sub partition of hashid
date3---0-99 sub partition of hashid
seg2(equally contains 30/10=3 date partitions)
date4---0-99 partition of hashid
date5---0-99 partition of hashid
date6---0-99 partition of hashid
...
..
seg10
date27---0-99 partition of hashid
date28---0-99 partition of hashid
date29---0-99 partition of hashid
また
推測2
seg1(distributed by 100hashid/10=10 hashid partitions)
date1---0-9 partition of hashid
date2---0-9 partition of hashid
...
date30---0-9 partition of hashid
seg2(equally contains 100hashid/10=10 hashid partitions)
date1---10-19 partition of hashid
date2---10-19 partition of hashid
...
date30---10-19 partition of hashid
これはどのように作動しますか?1 つまたは 2 つ推測してください。両方とも間違っている場合は、セグメント レベルでの配布方法を教えてください。
ハッシュIDに基づいてサブパーティション化するのは良い設計ですか。私は毎日 600 万件のレコードを扱っており、1 年間日付を保存する必要があるため、検索でヒットするデータの部分を非常に少なくしたいと考えていました。つまり、キー クエリに基づいて、ハッシュ ID の範囲を決定し、それらの特定のパーティションを検索します。
ありがとうガネーシュ.R