hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Gray <jg...@fb.com>
Subject RE: Quick way to find the number of rows in a Table
Date Fri, 03 Dec 2010 02:25:47 GMT
So you want to have an incrementing ID as the row key, and each time you generate it, you're
thinking about counting the number of rows?
	
How often would you be doing this count?

Row counting will always be expensive, so if this is for incrementing ID assignment, you should
look at the increment operation and store the ID in a separate table.  Or if you have long-lived
clients but that start/stop, just persist where you left off when you stopped.

We can help more if you provide more details about what you're trying to do and what exactly
this process is (how often does it run, for how long, is there more than one).

JG

> -----Original Message-----
> From: Peter Haidinyak [mailto:phaidinyak@local.com]
> Sent: Thursday, December 02, 2010 4:03 PM
> To: user@hbase.apache.org
> Subject: Quick way to find the number of rows in a Table
> 
> Hi
>    I am going to have a process running that will add rows to a table. The
> row id is just a counter of the number of rows inserted. Is there a quick
> way to programmatically find out the number of rows in a table so when I
> start adding rows the count isn't disrupted? Also, is there a better way to
> assign a row Id?
> 
> Thanks
> 
> -Pete

Mime
View raw message