Hbase 实战 4.1 点滴

4.1.4 Targeted data access

......

Putting data into the cell value occupies the same amount of storage space as putting it into the column qualifier 

or the rowkey. But you can possibly achieve better performance by moving it up from the cell to the rowkey. The downside to putting more in the rowkey is a biggerblock index, given that the keys are the only bits that go into the index.

把数据放入单元值占用的存储空间与把它放到列限定符或者行键中一样。但是把数据保存在行键中可能会获得更好的性能。考虑到block索引就是索引行键,行键越长,block索引将会越大。 

上面的话有问题。每个单元值都是按照keyvalue格式存储的,key由行键、列族、列限定符、时间组成。行键和列族是冗余的。所以把数据存在行键和列限定符、单元值中占的空间是不一样的。不明白,为什么要设计成这样的?

既然每个表的每个region的列族是单独保存的,那么保存在一个HFile里面的单元值的列族都是一样的,那么,何必要在key里面加上列族呢?

同一列族内的一行数据可以存放到一起,这样只要一个行键就行了?为什么非要每一个keyvalue的key都要加上行键呢呢?


HFile的格式这篇文章写得不错。

http://my.oschina.net/zhengyang841117/blog/188723

猜你喜欢

转载自blog.csdn.net/silent1/article/details/45718907