From user-return-14228-apmail-hbase-user-archive=hbase.apache.org@hbase.apache.org Fri Dec 03 05:12:30 2010 Return-Path: Delivered-To: apmail-hbase-user-archive@www.apache.org Received: (qmail 250 invoked from network); 3 Dec 2010 05:12:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Dec 2010 05:12:30 -0000 Received: (qmail 86211 invoked by uid 500); 3 Dec 2010 05:12:29 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 86154 invoked by uid 500); 3 Dec 2010 05:12:29 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 86140 invoked by uid 99); 3 Dec 2010 05:12:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Dec 2010 05:12:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [68.230.241.44] (HELO fed1rmmtao102.cox.net) (68.230.241.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Dec 2010 05:12:22 +0000 Received: from fed1rmimpo01.cox.net ([70.169.32.71]) by fed1rmmtao102.cox.net (InterMail vM.8.01.03.00 201-2260-125-20100507) with ESMTP id <20101203051201.DPFH21172.fed1rmmtao102.cox.net@fed1rmimpo01.cox.net> for ; Fri, 3 Dec 2010 00:12:01 -0500 Received: from mail.cox.net ([98.164.198.146]) by fed1rmimpo01.cox.net with bizsmtp id eVC11f00F3A0RV603VC17g; Fri, 03 Dec 2010 00:12:01 -0500 X-VR-Score: -100.00 X-Authority-Analysis: v=1.1 cv=VlRHJCZteP/uVpRP0DAW4f2c4MffF5XoHNkY4NIdffo= c=1 sm=1 a=n95O0F6-24kA:10 a=Q9fys5e9bTEA:10 a=4hFygy4g7BtMGA0VZ6nZsQ==:17 a=FOH2dFAWAAAA:8 a=uwOmkckxAAAA:8 a=mV9VRH-2AAAA:8 a=uxznMBMp6zAqfLIzJ2kA:9 a=rpylVAydslyYr1HirnYA:7 a=6vLgVw1j8fYpbba-OtxZkf1HukkA:4 a=PUjeQqilurYA:10 a=npO87R0EFmwA:10 a=rw6EdN86nWsA:10 a=_68um2vsPNOsTfaa:21 a=lYDstGTZ6fb2YunB:21 a=4hFygy4g7BtMGA0VZ6nZsQ==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; none Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: user@hbase.apache.org Subject: Re: Quick way to find the number of rows in a Table References: <321C2E54215EEB41A581FDD9DAECBC5DFCB2B302@IRV1EXMB01.eLiberation.com> <5A76F6CE309AD049AAF9A039A39242820F1A5CF5@sc-mbx04.TheFacebook.com> Date: Thu, 02 Dec 2010 21:12:01 -0800 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pete Haidinyak" Organization: Village Idiots Message-ID: In-Reply-To: <5A76F6CE309AD049AAF9A039A39242820F1A5CF5@sc-mbx04.TheFacebook.com> User-Agent: Opera Mail/10.63 (Win32) Good idea! Thanks -Pete On Thu, 02 Dec 2010 18:25:47 -0800, Jonathan Gray wrote: > 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