{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/25431","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/25431/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/25431/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/25431/events","html_url":"https://github.com/cockroachdb/cockroach/issues/25431","id":322414775,"number":25431,"title":"sql: support lookup joins on secondary indexes","user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars0.githubusercontent.com/u/6201335?v=4","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},"labels":[{"id":912869960,"url":"https://api.github.com/repos/cockroachdb/cockroach/labels/A-sql-execution","name":"A-sql-execution","color":"22aa88","default":false},{"id":406290612,"url":"https://api.github.com/repos/cockroachdb/cockroach/labels/C-performance","name":"C-performance","color":"c5def5","default":false},{"id":560667564,"url":"https://api.github.com/repos/cockroachdb/cockroach/labels/O-support","name":"O-support","color":"666ad1","default":false}],"state":"open","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":{"url":"https://api.github.com/repos/cockroachdb/cockroach/milestones/13","html_url":"https://github.com/cockroachdb/cockroach/milestone/13","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones/13/labels","id":2745639,"number":13,"title":"2.1","description":"","creator":{"login":"knz","id":642886,"avatar_url":"https://avatars3.githubusercontent.com/u/642886?v=4","gravatar_id":"","url":"https://api.github.com/users/knz","html_url":"https://github.com/knz","followers_url":"https://api.github.com/users/knz/followers","following_url":"https://api.github.com/users/knz/following{/other_user}","gists_url":"https://api.github.com/users/knz/gists{/gist_id}","starred_url":"https://api.github.com/users/knz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knz/subscriptions","organizations_url":"https://api.github.com/users/knz/orgs","repos_url":"https://api.github.com/users/knz/repos","events_url":"https://api.github.com/users/knz/events{/privacy}","received_events_url":"https://api.github.com/users/knz/received_events","type":"User","site_admin":false},"open_issues":562,"closed_issues":243,"state":"open","created_at":"2017-09-05T15:30:49Z","updated_at":"2018-05-14T16:39:36Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2018-05-11T19:51:39Z","updated_at":"2018-05-14T16:54:55Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Lookup joins are currently only supported when the right side of the join (the lookup side) is for the primary index. Supporting secondary index lookup joins requires an extra level of lookup (if the secondary index doesn't cover the columns in the query): first level lookup finds the primary key and the second level lookup reads the row. We have at least one user with a query which can benefit from this. The workaround is to perform the join \"in the application\", which is unsatisfactory.\r\n\r\nIf adding support for lookup joins on secondary indexes is not too intrusive, we should consider backporting this to 2.0.x."},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/388887532","html_url":"https://github.com/cockroachdb/cockroach/issues/25431#issuecomment-388887532","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/25431","id":388887532,"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-14T16:54:55Z","updated_at":"2018-05-14T16:54:55Z","author_association":"CONTRIBUTOR","body":"The approach @petermattis described makes sense to me, but it seems like we could also handle the second lookup via physical planning by adding an index join after the lookup join. I think that would keep the joinreader logic simpler since we wouldn't have to add the nested RowFetcher, but can anyone think of disadvantages?"}}
{"actor":{"display_login":"solongordon"}}