{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/25628","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/25628/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/25628/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/25628/events","html_url":"https://github.com/cockroachdb/cockroach/pull/25628","id":324155422,"number":25628,"title":"distsql: support lookup join on secondary index","user":{"login":"solongordon","id":679246,"avatar_url":"https://avatars1.githubusercontent.com/u/679246?v=4","gravatar_id":"","url":"https://api.github.com/users/solongordon","html_url":"https://github.com/solongordon","followers_url":"https://api.github.com/users/solongordon/followers","following_url":"https://api.github.com/users/solongordon/following{/other_user}","gists_url":"https://api.github.com/users/solongordon/gists{/gist_id}","starred_url":"https://api.github.com/users/solongordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solongordon/subscriptions","organizations_url":"https://api.github.com/users/solongordon/orgs","repos_url":"https://api.github.com/users/solongordon/repos","events_url":"https://api.github.com/users/solongordon/events{/privacy}","received_events_url":"https://api.github.com/users/solongordon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-17T19:30:12Z","updated_at":"2018-05-17T19:58:47Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/25628","html_url":"https://github.com/cockroachdb/cockroach/pull/25628","diff_url":"https://github.com/cockroachdb/cockroach/pull/25628.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/25628.patch"},"body":"joinReader now supports lookup joins on secondary indexes. This was a\r\ntrivial change for queries where all the output columns are included in\r\nthe secondary index. I just modified the physical planner to specify the\r\nsecondary index in the JoinReaderSpec and removed checks which prevented\r\nsecondary indexes from being used.\r\n\r\nThe more complicated situation is when we want to do a lookup join\r\nagainst a non-covering index. In this case, the logical planner plans an\r\nindex join before the inner join, but we want to perform the lookup join\r\nfirst. We now handle this by only planning the lookup join during\r\nphysical planning, not the index join. During execution, the joinReader\r\ndetects that there are output columns not covered by the secondary\r\nindex, and it performs primary index lookups as necessary to retrieve\r\nthe additional columns.\r\n\r\nFixes #25431"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/389990357","html_url":"https://github.com/cockroachdb/cockroach/pull/25628#issuecomment-389990357","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/25628","id":389990357,"user":{"login":"solongordon","id":679246,"avatar_url":"https://avatars1.githubusercontent.com/u/679246?v=4","gravatar_id":"","url":"https://api.github.com/users/solongordon","html_url":"https://github.com/solongordon","followers_url":"https://api.github.com/users/solongordon/followers","following_url":"https://api.github.com/users/solongordon/following{/other_user}","gists_url":"https://api.github.com/users/solongordon/gists{/gist_id}","starred_url":"https://api.github.com/users/solongordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solongordon/subscriptions","organizations_url":"https://api.github.com/users/solongordon/orgs","repos_url":"https://api.github.com/users/solongordon/repos","events_url":"https://api.github.com/users/solongordon/events{/privacy}","received_events_url":"https://api.github.com/users/solongordon/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T19:58:47Z","updated_at":"2018-05-17T19:58:47Z","author_association":"CONTRIBUTOR","body":"Is it acceptable not to add a new version for this feature since lookup joins are still experimental?\n\n---\n\nReview status: 0 of 3 files reviewed at latest revision, all discussions resolved.\n\n---\n\n\n\n*Comments from [Reviewable](https://reviewable.io/reviews/cockroachdb/cockroach/25628#-:-LCjfZsW6u4R3owS-k_J:b-ee9e2b)*\n<!-- Sent from Reviewable.io -->\n"}}
{"actor":{"display_login":"solongordon"}}