Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> Fastest way to read only the keys of a HTable?


Copy link to this message
-
Fastest way to read only the keys of a HTable?
I want to read only the keys in a table. I tried this...

    try {

 HTable table = new HTable("myTable");

 Scan scan = new Scan();

 scan.addFamily(Bytes.toBytes("Info"));

 ResultScanner scanner = table.getScanner(scan);

   Result result = scanner.next();

 while (result != null) {

& so on...

This was performing fairly well until I added another Family that contains
lots of key/value pairs.  My understanding was that adding another family
wouldn't affect performance of this code because I am explicitly using
"Info", but it is.

Anyway, in this particular use case, I only care about the "Key" of the row.
 I don't need any values from any of the families.  What's the best way to
do this?

Please let me know.  Thanks.