{"action":"opened","issue":{"url":"https://api.github.com/repos/slamdata/slamengine/issues/816","labels_url":"https://api.github.com/repos/slamdata/slamengine/issues/816/labels{/name}","comments_url":"https://api.github.com/repos/slamdata/slamengine/issues/816/comments","events_url":"https://api.github.com/repos/slamdata/slamengine/issues/816/events","html_url":"https://github.com/slamdata/slamengine/issues/816","id":91870972,"number":816,"title":"performance: push filtering ahead of join when possible","user":{"login":"mossprescott","id":6147371,"avatar_url":"https://avatars.githubusercontent.com/u/6147371?v=3","gravatar_id":"","url":"https://api.github.com/users/mossprescott","html_url":"https://github.com/mossprescott","followers_url":"https://api.github.com/users/mossprescott/followers","following_url":"https://api.github.com/users/mossprescott/following{/other_user}","gists_url":"https://api.github.com/users/mossprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/mossprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossprescott/subscriptions","organizations_url":"https://api.github.com/users/mossprescott/orgs","repos_url":"https://api.github.com/users/mossprescott/repos","events_url":"https://api.github.com/users/mossprescott/events{/privacy}","received_events_url":"https://api.github.com/users/mossprescott/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/slamdata/slamengine/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-29T18:13:03Z","updated_at":"2015-06-29T18:13:03Z","closed_at":null,"body":"For example, in this query:\r\n```sql\r\nselect * from a join b on a.id = b.parentId where a.x = 1 and b.y = 3\r\n```\r\nThe join may produce many results, but the `where` clause may reduce them to just a few (see #793, for  a case where a user ran into this).\r\n\r\nWe should detect this pattern in the logical plan and push the filter operation(s) ahead of the join, for a potentially massive reduction in the size of the joined temporary.\r\n"}}