Return-Path: X-Original-To: apmail-accumulo-notifications-archive@minotaur.apache.org Delivered-To: apmail-accumulo-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 07AA3DB5E for ; Fri, 28 Sep 2012 13:49:09 +0000 (UTC) Received: (qmail 1994 invoked by uid 500); 28 Sep 2012 13:49:09 -0000 Delivered-To: apmail-accumulo-notifications-archive@accumulo.apache.org Received: (qmail 1926 invoked by uid 500); 28 Sep 2012 13:49:08 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 1901 invoked by uid 99); 28 Sep 2012 13:49:08 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2012 13:49:08 +0000 Date: Sat, 29 Sep 2012 00:49:08 +1100 (NCT) From: "Christopher Tubbs (JIRA)" To: notifications@accumulo.apache.org Message-ID: <1170281096.139171.1348840148334.JavaMail.jiratomcat@arcas> In-Reply-To: <849904581.121442.1348570567765.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (ACCUMULO-775) Optimize iterator seek() method when seeking forward MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ACCUMULO-775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13465604#comment-13465604 ] Christopher Tubbs commented on ACCUMULO-775: -------------------------------------------- That's great, but I still see performance gains with scanning over X entries before deciding to seek, so it seems there is some room for further optimization, which we may be able to predict at a lower layer more reliably than the person writing (or the person using, in the case of a configurable iterator) the iterator that applies this scan-before-seek pattern. > Optimize iterator seek() method when seeking forward > ---------------------------------------------------- > > Key: ACCUMULO-775 > URL: https://issues.apache.org/jira/browse/ACCUMULO-775 > Project: Accumulo > Issue Type: Improvement > Components: tserver > Reporter: Christopher Tubbs > Assignee: Keith Turner > Labels: iterator, scan, seek > Fix For: 1.5.0 > > > At present, seeking is a very expensive operation. Yet, it is a very common case, especially when writing filtering/consuming/skipping iterators to seek to the next possible match (perhaps in the next row, when matching a column family with a regular expression), rather than continuing to iterate. A common solution to the problem of whether to scan or seek is to continue to scan for some threshold (~10-20 entries), hoping to just "run into" the next possible match, rather than waste resources seeking directly to it. > This pattern can be rolled in to the lower level iterator, so that iterators on top don't have to do this. They can seek, and the underlying source iterator can simply consume the next X entries when it makes sense, rather than waste resources seeking. > I could be wrong (please comment and correct me below if I am), but I imagine that the places where this would make the most sense is if the data currently being sought (seek'd) is in the current compressed block from the underlying file, especially if it is forward, relative to the current pointer. A better seek method should be able to tell where one currently is, and whether the requested data is within reach without doing all the expensive operations to re-seek to the same compressed block that is already loaded, reload it, decompress it, and scan to the requested starting point. > Having such an optimization would eliminate the need for users to try to calibrate their own such scan vs. seek optimization based on guessing whether their data is in the current block or another one, while still getting that same performance benefit. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira