我有一個Greenplum數據庫,其中有10個段反映了10個硬盤。我的表格分爲基於日期的主分區和基於散列ID的輔助分區。因此,一個月將有30個主分區,每個分區包含100個子分區。並且子分區中的數據基於hashid加載。現在的問題是這些分區如何在這些分段之間分配。Greenplum段之間的數據分佈
猜想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
OR
猜測二
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萬條記錄,而且我必須將日期存儲一年,因此我希望搜索只能使用非常少的數據。換言之,基於我將確定的密鑰查詢和hashid範圍,它將在這些特定分區中進行搜索。
感謝 Ganesh.R
我使用的是單節點版本,所以你的意思是說,每個段將包含30日期分區,並在每個日期100個子分區。那麼每個分區總共有3000個分區? –
正確。每段3000個分區。 –