{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6414","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6414/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6414/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6414/events","html_url":"https://github.com/cockroachdb/cockroach/pull/6414","id":151977719,"number":6414,"title":"storage: optimize runs of put/cput commands if writing to virgin keyspace","user":{"login":"spencerkimball","id":6147149,"avatar_url":"https://avatars.githubusercontent.com/u/6147149?v=3","gravatar_id":"","url":"https://api.github.com/users/spencerkimball","html_url":"https://github.com/spencerkimball","followers_url":"https://api.github.com/users/spencerkimball/followers","following_url":"https://api.github.com/users/spencerkimball/following{/other_user}","gists_url":"https://api.github.com/users/spencerkimball/gists{/gist_id}","starred_url":"https://api.github.com/users/spencerkimball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencerkimball/subscriptions","organizations_url":"https://api.github.com/users/spencerkimball/orgs","repos_url":"https://api.github.com/users/spencerkimball/repos","events_url":"https://api.github.com/users/spencerkimball/events{/privacy}","received_events_url":"https://api.github.com/users/spencerkimball/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2016-04-29T22:01:18Z","updated_at":"2016-05-10T10:11:59Z","closed_at":"2016-05-03T21:20:28Z","pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6414","html_url":"https://github.com/cockroachdb/cockroach/pull/6414","diff_url":"https://github.com/cockroachdb/cockroach/pull/6414.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/6414.patch"},"body":"…yspace\r\n\r\nIf more than 10 contiguous put or cput commands, the keyspace is searched\r\nusing a full order iterator to determine whether it's clear, in which case\r\nthe \"blind\" versions of MVCCPut and MVCCConditionalPut are used to more\r\nefficiently write values without requiring a prefix iterator to search for\r\nan existing value on each put.\r\n\r\nStable sorting was discontinued as it showed a performance hit on the\r\nbenchmarks, even for randomly ordered insertions.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/6414)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/218115465","html_url":"https://github.com/cockroachdb/cockroach/pull/6414#issuecomment-218115465","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6414","id":218115465,"user":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T10:11:59Z","updated_at":"2016-05-10T10:11:59Z","body":"\n\n\n\n\n\nReviewed 6 of 6 files at r1.\nReview status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful.\n\n---\n\n*[storage/replica.go, line 1868 \\[r2\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/6414#-KGugex_051dP0H6Shr7:-KHP8LbrBDBuq9RVA24W:-1699191217) ([raw file](https://github.com/cockroachdb/cockroach/blob/a1e897909191da385eabe01c7c4e810dd60e32b8/storage/replica.go#L1868)):*\n<details><summary><i>Previously, petermattis (Peter Mattis) wrote…</i></summary>\n> Probably worth a comment in the code, but I don't think mixing range-local and range-global keys would cause a problem. Yes, we'd be scanning outside of the range's jurisdiction, but we're not doing anything with the key that is found, simply determining if any key exists within a span. </details>\nI don't think it would be a correctness problem, but it could undermine this optimization if a key outside the range could prevent it from being applied. Probably wouldn't matter much, though, since no user transactions should touch range-local keys; those are just for non-performance-critical actions like splits and replica changes. \n\n---\n\n\n*Comments from [Reviewable](https://reviewable.io:443/reviews/cockroachdb/cockroach/6414)*\n<!-- Sent from Reviewable.io -->\n"}}