{"action":"opened","number":4217,"pull_request":{"url":"https://api.github.com/repos/facebook/rocksdb/pulls/4217","id":205579425,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1NTc5NDI1","html_url":"https://github.com/facebook/rocksdb/pull/4217","diff_url":"https://github.com/facebook/rocksdb/pull/4217.diff","patch_url":"https://github.com/facebook/rocksdb/pull/4217.patch","issue_url":"https://api.github.com/repos/facebook/rocksdb/issues/4217","number":4217,"state":"open","locked":false,"title":"Reduce binary search during iterator reseek","user":{"login":"siying","id":5334567,"node_id":"MDQ6VXNlcjUzMzQ1Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/5334567?v=4","gravatar_id":"","url":"https://api.github.com/users/siying","html_url":"https://github.com/siying","followers_url":"https://api.github.com/users/siying/followers","following_url":"https://api.github.com/users/siying/following{/other_user}","gists_url":"https://api.github.com/users/siying/gists{/gist_id}","starred_url":"https://api.github.com/users/siying/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siying/subscriptions","organizations_url":"https://api.github.com/users/siying/orgs","repos_url":"https://api.github.com/users/siying/repos","events_url":"https://api.github.com/users/siying/events{/privacy}","received_events_url":"https://api.github.com/users/siying/received_events","type":"User","site_admin":false},"body":"Summary: When users call Seek() multiple times in the same iterator, there is usually some locality among the seek keys. To reduce binary search in those cases, we can always check whether the current data file and data block cover the seek key, if it is the case, we can avoid the binary search to find the file or block.\r\n\r\nWhether we can use the same data file is figured out by looking at the smallest and largest key of the current file; for data block, we seek to the first key of the data block to check the lower bound, and use the key of the current index iterator to check the upper bound.\r\n\r\nThe fact that index iter can be either user key or internal key highly complicated things. InternalIterator::parsed_internal_key() is introduced to consolidate the interface of the two. There are code chagne everywhere to adapt this new interface, but I believe it actually simplifies the code so it's a good change anyway.\r\n\r\nTest Plan: Add a unit test.","created_at":"2018-08-01T23:18:42Z","updated_at":"2018-08-01T23:18:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/rocksdb/pulls/4217/commits","review_comments_url":"https://api.github.com/repos/facebook/rocksdb/pulls/4217/comments","review_comment_url":"https://api.github.com/repos/facebook/rocksdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/rocksdb/issues/4217/comments","statuses_url":"https://api.github.com/repos/facebook/rocksdb/statuses/97d6ec91db21a5f94d229666a479d824a3474557","head":{"label":"siying:reseek","ref":"reseek","sha":"97d6ec91db21a5f94d229666a479d824a3474557","user":{"login":"siying","id":5334567,"node_id":"MDQ6VXNlcjUzMzQ1Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/5334567?v=4","gravatar_id":"","url":"https://api.github.com/users/siying","html_url":"https://github.com/siying","followers_url":"https://api.github.com/users/siying/followers","following_url":"https://api.github.com/users/siying/following{/other_user}","gists_url":"https://api.github.com/users/siying/gists{/gist_id}","starred_url":"https://api.github.com/users/siying/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siying/subscriptions","organizations_url":"https://api.github.com/users/siying/orgs","repos_url":"https://api.github.com/users/siying/repos","events_url":"https://api.github.com/users/siying/events{/privacy}","received_events_url":"https://api.github.com/users/siying/received_events","type":"User","site_admin":false},"repo":{"id":48715206,"node_id":"MDEwOlJlcG9zaXRvcnk0ODcxNTIwNg==","name":"rocksdb","full_name":"siying/rocksdb","owner":{"login":"siying","id":5334567,"node_id":"MDQ6VXNlcjUzMzQ1Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/5334567?v=4","gravatar_id":"","url":"https://api.github.com/users/siying","html_url":"https://github.com/siying","followers_url":"https://api.github.com/users/siying/followers","following_url":"https://api.github.com/users/siying/following{/other_user}","gists_url":"https://api.github.com/users/siying/gists{/gist_id}","starred_url":"https://api.github.com/users/siying/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siying/subscriptions","organizations_url":"https://api.github.com/users/siying/orgs","repos_url":"https://api.github.com/users/siying/repos","events_url":"https://api.github.com/users/siying/events{/privacy}","received_events_url":"https://api.github.com/users/siying/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/siying/rocksdb","description":"A library that provides an embeddable, persistent key-value store for fast storage.","fork":true,"url":"https://api.github.com/repos/siying/rocksdb","forks_url":"https://api.github.com/repos/siying/rocksdb/forks","keys_url":"https://api.github.com/repos/siying/rocksdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/siying/rocksdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/siying/rocksdb/teams","hooks_url":"https://api.github.com/repos/siying/rocksdb/hooks","issue_events_url":"https://api.github.com/repos/siying/rocksdb/issues/events{/number}","events_url":"https://api.github.com/repos/siying/rocksdb/events","assignees_url":"https://api.github.com/repos/siying/rocksdb/assignees{/user}","branches_url":"https://api.github.com/repos/siying/rocksdb/branches{/branch}","tags_url":"https://api.github.com/repos/siying/rocksdb/tags","blobs_url":"https://api.github.com/repos/siying/rocksdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/siying/rocksdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/siying/rocksdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/siying/rocksdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/siying/rocksdb/statuses/{sha}","languages_url":"https://api.github.com/repos/siying/rocksdb/languages","stargazers_url":"https://api.github.com/repos/siying/rocksdb/stargazers","contributors_url":"https://api.github.com/repos/siying/rocksdb/contributors","subscribers_url":"https://api.github.com/repos/siying/rocksdb/subscribers","subscription_url":"https://api.github.com/repos/siying/rocksdb/subscription","commits_url":"https://api.github.com/repos/siying/rocksdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/siying/rocksdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/siying/rocksdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/siying/rocksdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/siying/rocksdb/contents/{+path}","compare_url":"https://api.github.com/repos/siying/rocksdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/siying/rocksdb/merges","archive_url":"https://api.github.com/repos/siying/rocksdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/siying/rocksdb/downloads","issues_url":"https://api.github.com/repos/siying/rocksdb/issues{/number}","pulls_url":"https://api.github.com/repos/siying/rocksdb/pulls{/number}","milestones_url":"https://api.github.com/repos/siying/rocksdb/milestones{/number}","notifications_url":"https://api.github.com/repos/siying/rocksdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/siying/rocksdb/labels{/name}","releases_url":"https://api.github.com/repos/siying/rocksdb/releases{/id}","deployments_url":"https://api.github.com/repos/siying/rocksdb/deployments","created_at":"2015-12-28T22:25:13Z","updated_at":"2018-07-30T23:16:24Z","pushed_at":"2018-08-01T23:18:08Z","git_url":"git://github.com/siying/rocksdb.git","ssh_url":"git@github.com:siying/rocksdb.git","clone_url":"https://github.com/siying/rocksdb.git","svn_url":"https://github.com/siying/rocksdb","homepage":"http://rocksdb.org","size":103639,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"892a156267797daebdcb0da69f14c76f8ffb2d46","user":{"login":"facebook","id":69631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5NjMx","avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":6934395,"node_id":"MDEwOlJlcG9zaXRvcnk2OTM0Mzk1","name":"rocksdb","full_name":"facebook/rocksdb","owner":{"login":"facebook","id":69631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5NjMx","avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/rocksdb","description":"A library that provides an embeddable, persistent key-value store for fast storage.","fork":false,"url":"https://api.github.com/repos/facebook/rocksdb","forks_url":"https://api.github.com/repos/facebook/rocksdb/forks","keys_url":"https://api.github.com/repos/facebook/rocksdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/rocksdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/rocksdb/teams","hooks_url":"https://api.github.com/repos/facebook/rocksdb/hooks","issue_events_url":"https://api.github.com/repos/facebook/rocksdb/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/rocksdb/events","assignees_url":"https://api.github.com/repos/facebook/rocksdb/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/rocksdb/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/rocksdb/tags","blobs_url":"https://api.github.com/repos/facebook/rocksdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/rocksdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/rocksdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/rocksdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/rocksdb/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/rocksdb/languages","stargazers_url":"https://api.github.com/repos/facebook/rocksdb/stargazers","contributors_url":"https://api.github.com/repos/facebook/rocksdb/contributors","subscribers_url":"https://api.github.com/repos/facebook/rocksdb/subscribers","subscription_url":"https://api.github.com/repos/facebook/rocksdb/subscription","commits_url":"https://api.github.com/repos/facebook/rocksdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/rocksdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/rocksdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/rocksdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/rocksdb/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/rocksdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/rocksdb/merges","archive_url":"https://api.github.com/repos/facebook/rocksdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/rocksdb/downloads","issues_url":"https://api.github.com/repos/facebook/rocksdb/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/rocksdb/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/rocksdb/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/rocksdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/rocksdb/labels{/name}","releases_url":"https://api.github.com/repos/facebook/rocksdb/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/rocksdb/deployments","created_at":"2012-11-30T06:16:18Z","updated_at":"2018-08-01T23:13:38Z","pushed_at":"2018-08-01T23:14:46Z","git_url":"git://github.com/facebook/rocksdb.git","ssh_url":"git@github.com:facebook/rocksdb.git","clone_url":"https://github.com/facebook/rocksdb.git","svn_url":"https://github.com/facebook/rocksdb","homepage":"http://rocksdb.org","size":116599,"stargazers_count":11165,"watchers_count":11165,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2454,"mirror_url":null,"archived":false,"open_issues_count":204,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2454,"open_issues":204,"watchers":11165,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/4217"},"html":{"href":"https://github.com/facebook/rocksdb/pull/4217"},"issue":{"href":"https://api.github.com/repos/facebook/rocksdb/issues/4217"},"comments":{"href":"https://api.github.com/repos/facebook/rocksdb/issues/4217/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/4217/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/4217/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/rocksdb/statuses/97d6ec91db21a5f94d229666a479d824a3474557"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":260,"deletions":98,"changed_files":9}}
{"actor":{"display_login":"siying"}}