[ 
https://issues.apache.org/jira/browse/CASSANDRA-9988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16105981#comment-16105981
 ] 

Jay Zhuang commented on CASSANDRA-9988:
---------------------------------------

Hi [~benedict], would you please point me the exponential search implementation 
for the branch iterator?

I tried to improve the 
[expSearch|https://github.com/cooldoger/cassandra/commit/a23a3422a894acb72a47975da035bbf8da50fc4b],
 here is [the improved 
version|https://github.com/cooldoger/cassandra/commit/7330646e553afd4b4b0011f6163bf9032f9cb605]
 which will do 1 comparison if it finds the target at the first stage. But 
that's optimized to find the target on {{2^i}} position, doesn't cover position 
0. To cover position 0 (the first element), I need to add more checks and code, 
it makes the code hard to understand.
And if we really do that, I could have the same optimization for binarySearch 
(manually check the first 1 or 2 elements), which results in the similar 
improvement.

> Introduce leaf-only iterator
> ----------------------------
>
>                 Key: CASSANDRA-9988
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9988
>             Project: Cassandra
>          Issue Type: Sub-task
>            Reporter: Benedict
>            Assignee: Jay Zhuang
>            Priority: Minor
>              Labels: patch
>             Fix For: 4.0
>
>         Attachments: 9988-data.png, 9988-result2.png, 9988-result3.png, 
> 9988-result.png, 9988-test-result3.png, 9988-test-result-expsearch.xlsx, 
> 9988-test-result-raw.png, 9988-test-result.xlsx, 9988-trunk-new.txt, 
> 9988-trunk-new-update.txt, trunk-9988.txt
>
>
> In many cases we have small btrees, small enough to fit in a single leaf 
> page. In this case it _may_ be more efficient to specialise our iterator.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to