简体   繁体   English

hbase-如果行键设计得很长(例如200 letter),但是它对扫描和过滤很有帮助。 长行键设计有什么害处吗?

[英]hbase - If the rowkey is designed very long(eg 200 letter ),but it is helpful for scan and filter. is there any harmful for the long rowkey design?

If the rowkey is designed very long(eg 200 letter ),but it is helpful for scan and filter. 如果行键设计得很长(例如200个字母),但是对扫描和筛选很有帮助。 is there harmful for the long rowkey design? 长行键设计有害吗?

I would say - don't make rowkeys too long . 我会说- 不要使行键太长 Even though, long rowkeys may seem tempting for scanning based on some filters , it will take up more heap space than warranted. 即使长的行键在基于某些筛选器的扫描中似乎很诱人,但它会占用比保证更多的堆空间。
Store files in hbase are LSM trees. To speed up random access within the store files , an index is stored for Data Block and Meta Block , which contain first key for each block along with other information. When added up for lots of blocks, it may take up big chunk of RAM.
Check the total size of store file index for hfiles and see if this is problemous in your case or not. 检查hfiles的存储文件索引的总大小,看看这是否对您有问题。
If unavoidable then some solutions may be - increase the block size and enable compression. 如果不可避免,则可能有一些解决方案-增加块大小并启用压缩。
Also look at https://issues.apache.org/jira/browse/HBASE-3551 for some interesting read. 另请参阅https://issues.apache.org/jira/browse/HBASE-3551,以获取一些有趣的内容。

There're two choices for rowkey design, tall-narrow and flat-wide . 行键设计有两种选择, tall-narrowflat-wide According to your business you can choose one of them. 根据您的业务,您可以选择其中之一。 There's no harm for the long rowkey desing. 长行键设计没有任何害处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM