{"action":"closed","number":76,"pull_request":{"url":"https://api.github.com/repos/greenplum-db/gporca/pulls/76","id":77880436,"html_url":"https://github.com/greenplum-db/gporca/pull/76","diff_url":"https://github.com/greenplum-db/gporca/pull/76.diff","patch_url":"https://github.com/greenplum-db/gporca/pull/76.patch","issue_url":"https://api.github.com/repos/greenplum-db/gporca/issues/76","number":76,"state":"closed","locked":false,"title":"[#125960675] Array Constraints Preprocesssing (Array Pt 3)","user":{"login":"cramja","id":5708822,"avatar_url":"https://avatars.githubusercontent.com/u/5708822?v=3","gravatar_id":"","url":"https://api.github.com/users/cramja","html_url":"https://github.com/cramja","followers_url":"https://api.github.com/users/cramja/followers","following_url":"https://api.github.com/users/cramja/following{/other_user}","gists_url":"https://api.github.com/users/cramja/gists{/gist_id}","starred_url":"https://api.github.com/users/cramja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramja/subscriptions","organizations_url":"https://api.github.com/users/cramja/orgs","repos_url":"https://api.github.com/users/cramja/repos","events_url":"https://api.github.com/users/cramja/events{/privacy}","received_events_url":"https://api.github.com/users/cramja/received_events","type":"User","site_admin":false},"body":"### Preprocessing stage for Array Conversion\r\n\r\nAdds an expression preprocessing stage to convert applicable expressions into array IN or NOT IN expressions. This creates more succinct expression trees and reduces redundancy in final expression output.\r\n\r\nTherefore an expression like `x = 1 OR x = 2` should be converted into the equivalent `x IN (1,2)`.\r\n\r\nThis feature works by doing a recursive walk of the expression tree which looks for multiple AND or OR children which are either array expressions or ScalarComparison children. It then converts them into Constraints. Constraints hold logic to detect redundancy and also to convert OR/AND statements into array statements (Array Pt 1).\r\n\r\nWe chose to put this method after step 8 of expression preprocessing because step 9 will propagate constraints, and therefore it makes sense to propagate array constraints instead of OR constraints because they are more succinct and also preprocessing will attempt to re-derive constraints from propagated constraints which can lead to redundant expressions being created if array constraints are not passed.\r\n\r\nThis feature is controlled by the `EnableArrayDerive` traceflag.\r\n\r\n@lpetrov-pivotal and I learned a lot about reference counting while implementing the Preprocessing method. We summarized our findings in [this document](https://docs.google.com/a/pivotal.io/document/d/1nndCf-ZreeLYtdXeVdOy6BHx_xgyVbVrv9GSdMkxoRg/edit?usp=sharing).","created_at":"2016-07-18T21:13:00Z","updated_at":"2016-08-05T00:43:10Z","closed_at":"2016-08-05T00:43:10Z","merged_at":null,"merge_commit_sha":"236dc263f3111302d3e714345f4d6015dbd5c9bf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/greenplum-db/gporca/pulls/76/commits","review_comments_url":"https://api.github.com/repos/greenplum-db/gporca/pulls/76/comments","review_comment_url":"https://api.github.com/repos/greenplum-db/gporca/pulls/comments{/number}","comments_url":"https://api.github.com/repos/greenplum-db/gporca/issues/76/comments","statuses_url":"https://api.github.com/repos/greenplum-db/gporca/statuses/090d9c28f38a25234fc36d264a78c77593d9e016","head":{"label":"greenplum-db:125960675_array_constraints_preprocesssing","ref":"125960675_array_constraints_preprocesssing","sha":"090d9c28f38a25234fc36d264a78c77593d9e016","user":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars.githubusercontent.com/u/14097842?v=3","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"repo":{"id":47849203,"name":"gporca","full_name":"greenplum-db/gporca","owner":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars.githubusercontent.com/u/14097842?v=3","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/greenplum-db/gporca","description":"A modular query optimizer for big data","fork":false,"url":"https://api.github.com/repos/greenplum-db/gporca","forks_url":"https://api.github.com/repos/greenplum-db/gporca/forks","keys_url":"https://api.github.com/repos/greenplum-db/gporca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greenplum-db/gporca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greenplum-db/gporca/teams","hooks_url":"https://api.github.com/repos/greenplum-db/gporca/hooks","issue_events_url":"https://api.github.com/repos/greenplum-db/gporca/issues/events{/number}","events_url":"https://api.github.com/repos/greenplum-db/gporca/events","assignees_url":"https://api.github.com/repos/greenplum-db/gporca/assignees{/user}","branches_url":"https://api.github.com/repos/greenplum-db/gporca/branches{/branch}","tags_url":"https://api.github.com/repos/greenplum-db/gporca/tags","blobs_url":"https://api.github.com/repos/greenplum-db/gporca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greenplum-db/gporca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greenplum-db/gporca/git/refs{/sha}","trees_url":"https://api.github.com/repos/greenplum-db/gporca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greenplum-db/gporca/statuses/{sha}","languages_url":"https://api.github.com/repos/greenplum-db/gporca/languages","stargazers_url":"https://api.github.com/repos/greenplum-db/gporca/stargazers","contributors_url":"https://api.github.com/repos/greenplum-db/gporca/contributors","subscribers_url":"https://api.github.com/repos/greenplum-db/gporca/subscribers","subscription_url":"https://api.github.com/repos/greenplum-db/gporca/subscription","commits_url":"https://api.github.com/repos/greenplum-db/gporca/commits{/sha}","git_commits_url":"https://api.github.com/repos/greenplum-db/gporca/git/commits{/sha}","comments_url":"https://api.github.com/repos/greenplum-db/gporca/comments{/number}","issue_comment_url":"https://api.github.com/repos/greenplum-db/gporca/issues/comments{/number}","contents_url":"https://api.github.com/repos/greenplum-db/gporca/contents/{+path}","compare_url":"https://api.github.com/repos/greenplum-db/gporca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greenplum-db/gporca/merges","archive_url":"https://api.github.com/repos/greenplum-db/gporca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greenplum-db/gporca/downloads","issues_url":"https://api.github.com/repos/greenplum-db/gporca/issues{/number}","pulls_url":"https://api.github.com/repos/greenplum-db/gporca/pulls{/number}","milestones_url":"https://api.github.com/repos/greenplum-db/gporca/milestones{/number}","notifications_url":"https://api.github.com/repos/greenplum-db/gporca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greenplum-db/gporca/labels{/name}","releases_url":"https://api.github.com/repos/greenplum-db/gporca/releases{/id}","deployments_url":"https://api.github.com/repos/greenplum-db/gporca/deployments","created_at":"2015-12-11T20:24:47Z","updated_at":"2016-08-02T10:56:27Z","pushed_at":"2016-08-05T00:42:19Z","git_url":"git://github.com/greenplum-db/gporca.git","ssh_url":"git@github.com:greenplum-db/gporca.git","clone_url":"https://github.com/greenplum-db/gporca.git","svn_url":"https://github.com/greenplum-db/gporca","homepage":"","size":19491,"stargazers_count":59,"watchers_count":59,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":8,"forks":38,"open_issues":8,"watchers":59,"default_branch":"master"}},"base":{"label":"greenplum-db:master","ref":"master","sha":"b5799554b381d9499b5de80cfb390c2aa2b8bc41","user":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars.githubusercontent.com/u/14097842?v=3","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"repo":{"id":47849203,"name":"gporca","full_name":"greenplum-db/gporca","owner":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars.githubusercontent.com/u/14097842?v=3","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/greenplum-db/gporca","description":"A modular query optimizer for big data","fork":false,"url":"https://api.github.com/repos/greenplum-db/gporca","forks_url":"https://api.github.com/repos/greenplum-db/gporca/forks","keys_url":"https://api.github.com/repos/greenplum-db/gporca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greenplum-db/gporca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greenplum-db/gporca/teams","hooks_url":"https://api.github.com/repos/greenplum-db/gporca/hooks","issue_events_url":"https://api.github.com/repos/greenplum-db/gporca/issues/events{/number}","events_url":"https://api.github.com/repos/greenplum-db/gporca/events","assignees_url":"https://api.github.com/repos/greenplum-db/gporca/assignees{/user}","branches_url":"https://api.github.com/repos/greenplum-db/gporca/branches{/branch}","tags_url":"https://api.github.com/repos/greenplum-db/gporca/tags","blobs_url":"https://api.github.com/repos/greenplum-db/gporca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greenplum-db/gporca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greenplum-db/gporca/git/refs{/sha}","trees_url":"https://api.github.com/repos/greenplum-db/gporca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greenplum-db/gporca/statuses/{sha}","languages_url":"https://api.github.com/repos/greenplum-db/gporca/languages","stargazers_url":"https://api.github.com/repos/greenplum-db/gporca/stargazers","contributors_url":"https://api.github.com/repos/greenplum-db/gporca/contributors","subscribers_url":"https://api.github.com/repos/greenplum-db/gporca/subscribers","subscription_url":"https://api.github.com/repos/greenplum-db/gporca/subscription","commits_url":"https://api.github.com/repos/greenplum-db/gporca/commits{/sha}","git_commits_url":"https://api.github.com/repos/greenplum-db/gporca/git/commits{/sha}","comments_url":"https://api.github.com/repos/greenplum-db/gporca/comments{/number}","issue_comment_url":"https://api.github.com/repos/greenplum-db/gporca/issues/comments{/number}","contents_url":"https://api.github.com/repos/greenplum-db/gporca/contents/{+path}","compare_url":"https://api.github.com/repos/greenplum-db/gporca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greenplum-db/gporca/merges","archive_url":"https://api.github.com/repos/greenplum-db/gporca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greenplum-db/gporca/downloads","issues_url":"https://api.github.com/repos/greenplum-db/gporca/issues{/number}","pulls_url":"https://api.github.com/repos/greenplum-db/gporca/pulls{/number}","milestones_url":"https://api.github.com/repos/greenplum-db/gporca/milestones{/number}","notifications_url":"https://api.github.com/repos/greenplum-db/gporca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greenplum-db/gporca/labels{/name}","releases_url":"https://api.github.com/repos/greenplum-db/gporca/releases{/id}","deployments_url":"https://api.github.com/repos/greenplum-db/gporca/deployments","created_at":"2015-12-11T20:24:47Z","updated_at":"2016-08-02T10:56:27Z","pushed_at":"2016-08-05T00:42:19Z","git_url":"git://github.com/greenplum-db/gporca.git","ssh_url":"git@github.com:greenplum-db/gporca.git","clone_url":"https://github.com/greenplum-db/gporca.git","svn_url":"https://github.com/greenplum-db/gporca","homepage":"","size":19491,"stargazers_count":59,"watchers_count":59,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":8,"forks":38,"open_issues":8,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gporca/pulls/76"},"html":{"href":"https://github.com/greenplum-db/gporca/pull/76"},"issue":{"href":"https://api.github.com/repos/greenplum-db/gporca/issues/76"},"comments":{"href":"https://api.github.com/repos/greenplum-db/gporca/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/greenplum-db/gporca/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/greenplum-db/gporca/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/greenplum-db/gporca/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/greenplum-db/gporca/statuses/090d9c28f38a25234fc36d264a78c77593d9e016"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":2,"review_comments":1,"commits":5,"additions":1442,"deletions":225,"changed_files":25}}
{"actor":{"display_login":"cramja"}}