1
votes

I would like to retrieve 1000 rows from an HBase table, rowkeys are arranged like this:

row1:    1000|0001
...
row1000: 1000|1000

My question is, would it be better to issue a range scan from 1000|0001 to 1000|1000 or issue a get for each row separately and submit them as a batch?

Rows are likely to be on the same region server.

2

2 Answers

2
votes

Scan, hands down. Multi-get is really there for non-contiguous data.

0
votes

For this use case, I would suggest to go with range scan by providing the start and end row key.

Because it would be simple for HBase to find the start key and get all records till before end key (End Key will be exclusive, so in your case the endKey will be 1000|1001) in a single scan request to region server.