Hello David Ribeiro Alves,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/6483

to review the following change.

Change subject: WIP: check for row presence in rowset-wise order
......................................................................

WIP: check for row presence in rowset-wise order

This changes the overall flow of applying batches of writes from:

  for each key in batch:
    find which rowsets may contain this key
    for each rowset:
      check if key is present in rowset
    if not present in any rowset, apply the write

to:

  sort all ops by key
  bulk-query the interval tree
  for each rowset:
    for each key which might be in that rowset, in sorted order:
      check if the key is present
      if so, mark it as such
  for each op:
    if it's not present in any rowset (based on above marking)
      apply it

The aim here is that because we end up accessing each rowset many times
sequentially in ascending key order, we open up the opportunity for two
potential optimizations:

1) a thread-local cache can keep seeked iterators within that rowset, as
   well as hot blocks such as the index blocks, and reuse it cross-op
   within the same batch
2) we can detect when several of the ops in a batch all fall into a
  "gap" in a particular rowset, and "skip ahead", short circuiting a
  bunch of checks

This patch isn't likely to give big wins on its own, but the further
patches in the series ought to.

TODO: do a quick benchmark or two to make sure this doesn't _regress_.
TODO: clean up

Change-Id: I9a678bb0da130ce94aae3634c82ace2d6898ffa2
---
M src/kudu/tablet/row_op.h
M src/kudu/tablet/tablet.cc
M src/kudu/tablet/tablet.h
3 files changed, 141 insertions(+), 45 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/83/6483/1
-- 
To view, visit http://gerrit.cloudera.org:8080/6483
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a678bb0da130ce94aae3634c82ace2d6898ffa2
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: David Ribeiro Alves <[email protected]>

Reply via email to