You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2013/04/13 19:04:16 UTC

[jira] [Created] (LUCENE-4932) DirectPostingsFormat can minimize binary searching in seek's

David Smiley created LUCENE-4932:
------------------------------------

             Summary: DirectPostingsFormat can minimize binary searching in seek's
                 Key: LUCENE-4932
                 URL: https://issues.apache.org/jira/browse/LUCENE-4932
             Project: Lucene - Core
          Issue Type: Improvement
          Components: core/codecs
            Reporter: David Smiley


I was looking at the DirectPostingsFormat to see exactly what it's doing when you I seekExact().  It does a plain binary search every time, even if I've positioned the state well into size of the array.  A comment (probably left by [~mikemccand]) shows that he too knows this could be done smarter:
{code}
        // TODO: we should use the skip pointers; should be
        // faster than bin search; we should also hold
        // & reuse current state so seeking forwards is
        // faster
{code}

This issue represents resolving that TODO so it's isn't forgotten.

For inspiration about solving this in a smarter way, see Solr's SortedIntDocSet which avoids binary search using an approach that could be borrowed for this codec.

--
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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org