Use Phoenix (https://github.com/forcedotcom/phoenix) by doing the following: CREATE VIEW "myHTableName" (key VARBINARY NOT NULL PRIMARY KEY); SELECT COUNT(*) FROM "myHTableName";
As [email protected] said, you still need to scan the table, but Phoenix will do it in parallel and use a coprocessor and an internal scanner API to speed things up. Thanks, James @JamesPlusPlus On Tue, Sep 10, 2013 at 7:01 PM, 冯宏华 <[email protected]> wrote: > No fast way to get the count of records of a table without scanning and > counting, especially when you want to get the accurate count. By design the > data/cells of a same record/row can scatter in many different HFiles and > memstore, so even we can record the count of records of each HFile as meta > in FileInfo, we still need to de-dup to get the accurate total count, which > only can be achieved by scanning. > ________________________________________ > 发件人: Ramasubramanian Narayanan [[email protected]] > 发送时间: 2013年9月10日 16:07 > 收件人: [email protected] > 主题: Fastest way to get count of records in huge hbase table? > > Dear All, > > Is there any fastest way to get the count of records in a huge HBASE table > with billions of records? > > The normal count command is running for a hour with this huge volume of > data.. > > regards, > Rams >
