我有一组 3 个关系表。我想将它们转换为 dynamodb 中的单个表。每个表都托管不同 tranType 的数据。每个表都有 Id, tranDate 作为它的键。对于给定的 Id、tranDate 和 tranType,有多个行。
我的访问模式是获取给定 Id 和 TranDate 的数据 - 这将为我获取所有 tranTypes 的数据。
对于给定的 Id、tranDate,每个表中的行在 400KB 以内,但如果我在 3 个表中添加给定 Id 和 tranDate 的行,它将超过 400KB。
Definitions
Table1
Id, tranDate,tranType,col1,col2,col3,col4
Table2
Id, tranDate,tranType,col1,col2,col3,col4,col5
Table3
Id, tranDate,tranType,col1,col2
Table1 (Sample Data)
1, 2018-12-01,'DETAIL',12,13,14,'A'
1, 2018-12-01,'DETAIL',15,23,11,'B'
1, 2018-12-01,'DETAIL',17,33,24,'C'
1, 2018-12-01,'DETAIL',19,43,14,'D'
2, 2018-12-01,'DETAIL',11,13,14,'A1'
2, 2018-12-01,'DETAIL',12,23,11,'B1'
1, 2018-11-01,'DETAIL',42,13,14,'X'
1, 2018-11-01,'DETAIL',45,23,11,'Y'
1, 2018-11-01,'DETAIL',47,33,24,'Z'
Table2 (Sample Data)
1, 2018-12-01,'SUMMARY',12,13,14,'A','S'
1, 2018-12-01,'SUMMARY',15,23,11,'B','B1'
2, 2018-12-01,'SUMMARY',17,33,24,'C','D1'
2, 2018-12-01,'SUMMARY',22,43,14,'D','D2'
2, 2018-12-01,'SUMMARY',33,13,14,'A1' ,'D3'
Table3 (Sample Data)
1, 2018-12-01,'GEO',11,'MI'
1, 2018-12-01,'GEO',12,'NY'
1, 2018-12-01,'GEO',11,'AL'
2, 2018-12-01,'GEO',14,'DE'
2, 2018-12-01,'GEO',15,'PA'
给定 Id=1,tranDate='2018-12-01' -- 预期结果
1, 2018-12-01,'DETAIL',12,13,14,'A'
1, 2018-12-01,'DETAIL',15,23,11,'B'
1, 2018-12-01,'DETAIL',17,33,24,'C'
1, 2018-12-01,'DETAIL',19,43,14,'D'
1, 2018-12-01,'SUMMARY',12,13,14,'A','S'
1, 2018-12-01,'SUMMARY',15,23,11,'B','B1'
1, 2018-12-01,'GEO',11,'MI'
1, 2018-12-01,'GEO',12,'NY'
1, 2018-12-01,'GEO',11,'AL'