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?

StackOverflow https://stackoverflow.com/questions/23184021

  •  06-07-2023
  •  | 
  •  

Question

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

Was it helpful?

Solution

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.
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.

OTHER TIPS

There're two choices for rowkey design,tall-narrow and flat-wide. According to your business you can choose one of them. There's no harm for the long rowkey desing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top