1

Is there an easy way of finding total number of rows in htable? I don't want to scan all the regions for that. If number of rows is stored somewhere in metadata of table or region then that will be great.

Rishi Kesh Dwivedi
  • 643
  • 2
  • 7
  • 15

4 Answers4

8

You could run count '<table_name>' in the HBase shell.

Rylander
  • 19,449
  • 25
  • 93
  • 144
  • 3
    This is not helpful for tables with a real size as it runs a serial process to 'scan all the regions'. – David Jan 10 '14 at 21:28
0

Are you looking RowCounter? I dont think there is any metadata information related to counts. Would be interested to know that.

Vijay Kukkala
  • 362
  • 5
  • 14
0

Unless there is something new after HBase introduced co-processors there is no fast way to determine the exact number of rows in a table. depending on your key structure, you might be able to get a rough estimate

David
  • 3,251
  • 18
  • 28
0

You can use coprocessors introduced in Hbase which gives the response in seconds.Use the AggregationClient to get the total count

Jijo
  • 611
  • 5
  • 18