Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> Slow row deletion performance in comparison to insertion


Copy link to this message
-
Re: Slow row deletion performance in comparison to insertion
There was some difference in the way locks are taken for batched deletes and puts.  This was fixed for 89.

I wonder if the same could be the issue here.

Sent from my iPhone

On Jun 27, 2012, at 2:04 PM, "Jeff Whiting" <[EMAIL PROTECTED]> wrote:

> I'm struggling to understand why my deletes are taking longer than my inserts.  My understanding is that a delete is just an insertion of a tombstone.  And I'm deleting the entire row.
>
> I do a simple loop (pseudo code) and insert the 100 byte rows:
>
> for (int i=0; i < 50000; i++)
> {
>    puts.append(new Put(rowkey[i], oneHundredBytes[i]));
>
>    if (puts.size() % 1000 == 0)
>    {
>        Benchmark.start();
>        table.batch(puts);
>        Benchmark.stop();
>    }
> }
>
>
> The above takes about 8282ms total.
>
> However the delete takes more than twice as long:
>
> Iterator it = table.getScannerScan(rowkey[0], rowkey[50000-1]).iterator();
> while(it.hasNext())
> {
>    r = it.next();
>    deletes.append(new Delete(r.getRow()));
>    if (deletes.size() % 1000 == 0)
>    {
>        Benchmark.start();
>        table.batch(deletes);
>        Benchmark.stop();
>    }
> }
>
> The above takes 17369ms total.
>
> I'm only benchmarking the deletion time and not the scan time. Additionally if I batch the deletes into one big one at the end (rather than while I'm scanning) it takes about the same amount of time. I am deleting the entire row so I wouldn't think it would be doing a read before the delete (http://mail-archives.apache.org/mod_mbox/hbase-user/201206.mbox/%[EMAIL PROTECTED]l%3E).
>
> Any thoughts on why it is slower and how I can speed it up?
>
> Thanks,
> ~Jeff
>
> --
> Jeff Whiting
> Qualtrics Senior Software Engineer
> [EMAIL PROTECTED]
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB