{"action":"created","issue":{"url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1028","labels_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1028/labels{/name}","comments_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1028/comments","events_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1028/events","html_url":"https://github.com/quasar-analytics/quasar/pull/1028","id":121774446,"number":1028,"title":"Optimize apparent cross joins","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/quasar-analytics/quasar/labels/in%20review","name":"in review","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"sellout","id":33031,"avatar_url":"https://avatars.githubusercontent.com/u/33031?v=3","gravatar_id":"","url":"https://api.github.com/users/sellout","html_url":"https://github.com/sellout","followers_url":"https://api.github.com/users/sellout/followers","following_url":"https://api.github.com/users/sellout/following{/other_user}","gists_url":"https://api.github.com/users/sellout/gists{/gist_id}","starred_url":"https://api.github.com/users/sellout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sellout/subscriptions","organizations_url":"https://api.github.com/users/sellout/orgs","repos_url":"https://api.github.com/users/sellout/repos","events_url":"https://api.github.com/users/sellout/events{/privacy}","received_events_url":"https://api.github.com/users/sellout/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-12-11T19:19:51Z","updated_at":"2015-12-11T19:52:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/quasar-analytics/quasar/pulls/1028","html_url":"https://github.com/quasar-analytics/quasar/pull/1028","diff_url":"https://github.com/quasar-analytics/quasar/pull/1028.diff","patch_url":"https://github.com/quasar-analytics/quasar/pull/1028.patch"},"body":"Includes a handful of small fixes, and then the main event:\r\n\r\nRewrite InnerJoin/Filter sequences, putting conditions before, in, or after the join.\r\n\r\nThe idea is to identify all filtering associated with an inner join in the source plan, breaking down all components into four categories:\r\n- conditions referring to only the left or only the right source, which can be moved ahead of the join (SD-910)\r\n- conditions referring to both sources using `=`, which can be rewritten into the join (SD-1063)\r\n- all others, which have to be done after the join\r\n\r\nThis is implemented in a new rewriteCrossJoins fold, which uses boundParaM (which is new). Because the new fold introduces new temp names which made it difficult for tests to compare plans, names are now rewritten to a compact sequence starting with `__tmp0` after rewriting cross joins. Nested lets are re-ordered to a consistent sequence. Also, the plan has to be simplified prior to the new fold, so all these steps are now wrapped up in `Optimizer.optimize`, which makes sure to run things in the proper sequence. This replaces the fold with `simplifyƒ` that was being called from several places before.\r\n\r\nAdded test for two queries which \"worked\" before but are now massively more efficient. Added an explicit time limit to the regression tests so these will fail definitively if the optimization stops working at some point. These tests (and all the rest) run in a few seconds locally, but the limit is quite high for now (45s) because some take as long as 25s in Travis."},"comment":{"url":"https://api.github.com/repos/quasar-analytics/quasar/issues/comments/164033241","html_url":"https://github.com/quasar-analytics/quasar/pull/1028#issuecomment-164033241","issue_url":"https://api.github.com/repos/quasar-analytics/quasar/issues/1028","id":164033241,"user":{"login":"codecov-io","id":8655789,"avatar_url":"https://avatars.githubusercontent.com/u/8655789?v=3","gravatar_id":"","url":"https://api.github.com/users/codecov-io","html_url":"https://github.com/codecov-io","followers_url":"https://api.github.com/users/codecov-io/followers","following_url":"https://api.github.com/users/codecov-io/following{/other_user}","gists_url":"https://api.github.com/users/codecov-io/gists{/gist_id}","starred_url":"https://api.github.com/users/codecov-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codecov-io/subscriptions","organizations_url":"https://api.github.com/users/codecov-io/orgs","repos_url":"https://api.github.com/users/codecov-io/repos","events_url":"https://api.github.com/users/codecov-io/events{/privacy}","received_events_url":"https://api.github.com/users/codecov-io/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T19:52:29Z","updated_at":"2015-12-11T19:52:29Z","body":"## [Current coverage][1] is `81.68%`\n> Merging **#1028** into **master** will decrease coverage by **-0.40%** as of [`169b2bb`][3]\n\n\n```diff\n@@            master   #1028   diff @@\n======================================\n  Files          128     128       \n  Stmts         8546    8605    +59\n  Branches       290     288     -2\n  Methods          0       0       \n======================================\n+ Hit           7015    7029    +14\n  Partial          0       0       \n- Missed        1531    1576    +45\n```\n\n> Review entire [Coverage Diff][4] as of [`169b2bb`][3]\n\n\n[1]: https://codecov.io/github/quasar-analytics/quasar?ref=169b2bb7ce8647bde443ad642628843fc786eac0\n[2]: https://codecov.io/github/quasar-analytics/quasar/features/suggestions?ref=169b2bb7ce8647bde443ad642628843fc786eac0\n[3]: https://codecov.io/github/quasar-analytics/quasar/commit/169b2bb7ce8647bde443ad642628843fc786eac0\n[4]: https://codecov.io/github/quasar-analytics/quasar/compare/e48f9965ae3c18ef5b348a03fd0e702085140aba...169b2bb7ce8647bde443ad642628843fc786eac0\n\n> Powered by [Codecov](https://codecov.io). Updated on successful CI builds."}}