{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/27110","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/27110/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/27110/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/27110/events","html_url":"https://github.com/cockroachdb/cockroach/pull/27110","id":337668335,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4NzkzMzAz","number":27110,"title":"opt: add support for reverse scans","user":{"login":"madhavsuresh","id":56649,"node_id":"MDQ6VXNlcjU2NjQ5","avatar_url":"https://avatars3.githubusercontent.com/u/56649?v=4","gravatar_id":"","url":"https://api.github.com/users/madhavsuresh","html_url":"https://github.com/madhavsuresh","followers_url":"https://api.github.com/users/madhavsuresh/followers","following_url":"https://api.github.com/users/madhavsuresh/following{/other_user}","gists_url":"https://api.github.com/users/madhavsuresh/gists{/gist_id}","starred_url":"https://api.github.com/users/madhavsuresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madhavsuresh/subscriptions","organizations_url":"https://api.github.com/users/madhavsuresh/orgs","repos_url":"https://api.github.com/users/madhavsuresh/repos","events_url":"https://api.github.com/users/madhavsuresh/events{/privacy}","received_events_url":"https://api.github.com/users/madhavsuresh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-07-02T21:24:47Z","updated_at":"2018-07-03T15:34:45Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/27110","html_url":"https://github.com/cockroachdb/cockroach/pull/27110","diff_url":"https://github.com/cockroachdb/cockroach/pull/27110.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/27110.patch"},"body":"The optimizer does not generate plans which include reverse scans.\r\nThis PR adds support logical support for reverse scans.\r\n\r\nRelease note: None"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/402199672","html_url":"https://github.com/cockroachdb/cockroach/pull/27110#issuecomment-402199672","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/27110","id":402199672,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjE5OTY3Mg==","user":{"login":"RaduBerinde","id":16544120,"node_id":"MDQ6VXNlcjE2NTQ0MTIw","avatar_url":"https://avatars1.githubusercontent.com/u/16544120?v=4","gravatar_id":"","url":"https://api.github.com/users/RaduBerinde","html_url":"https://github.com/RaduBerinde","followers_url":"https://api.github.com/users/RaduBerinde/followers","following_url":"https://api.github.com/users/RaduBerinde/following{/other_user}","gists_url":"https://api.github.com/users/RaduBerinde/gists{/gist_id}","starred_url":"https://api.github.com/users/RaduBerinde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaduBerinde/subscriptions","organizations_url":"https://api.github.com/users/RaduBerinde/orgs","repos_url":"https://api.github.com/users/RaduBerinde/repos","events_url":"https://api.github.com/users/RaduBerinde/events{/privacy}","received_events_url":"https://api.github.com/users/RaduBerinde/received_events","type":"User","site_admin":false},"created_at":"2018-07-03T15:34:45Z","updated_at":"2018-07-03T15:34:45Z","author_association":"MEMBER","body":"\n\n\n\nReview status: :shipit: complete! 0 of 0 LGTMs obtained\n\n---\n\n*[pkg/sql/opt/xform/coster.go, line 132 at r4](https://reviewable.io/reviews/cockroachdb/cockroach/27110#-LGVjMbF7zOox0PiVh3c:-LGVl0dH2Anapl16s-sP:b4ej6g0) ([raw file](https://github.com/cockroachdb/cockroach/blob/0a7290da488cd93860ebcce725bd0dd5ec1b9b3e/pkg/sql/opt/xform/coster.go#L132)):*\n<details><summary><i>Previously, andy-kimball (Andy Kimball) wrote…</i></summary><blockquote>\n\nRadu should weigh in here, but I don't think the multiplier should be applied to the IO cost, but instead to the CPU cost (i.e. `rowScanCost` portion). Iterating in reverse doesn't change how costly it is to fetch the rows from disk/network into memory, but instead on how costly it is to iterate once in memory.\n</blockquote></details>\n\nIn practice it is 2-3x more expensive overall, so a 2x factor for everything seems fine to me. I think the IO pattern is less efficient in this case, or we wouldn't see that big of a difference.\n\nNote that a rev scan is not merely a forward scan + a reverse in-memory iteration. You can do a rev scan on a huge table to get just the last few rows and this doesn't read the entire table.\n\n---\n\n\n*Comments from [Reviewable](https://reviewable.io/reviews/cockroachdb/cockroach/27110)*\n<!-- Sent from Reviewable.io -->\n"}}
{"actor":{"display_login":"RaduBerinde"}}