{"action":"closed","number":6577,"pull_request":{"url":"https://api.github.com/repos/mautic/mautic/pulls/6577","id":215427515,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NDI3NTE1","html_url":"https://github.com/mautic/mautic/pull/6577","diff_url":"https://github.com/mautic/mautic/pull/6577.diff","patch_url":"https://github.com/mautic/mautic/pull/6577.patch","issue_url":"https://api.github.com/repos/mautic/mautic/issues/6577","number":6577,"state":"closed","locked":false,"title":"Use IN instead of EXISTS for including manually added contacts which …","user":{"login":"mitresh95","id":40765189,"node_id":"MDQ6VXNlcjQwNzY1MTg5","avatar_url":"https://avatars0.githubusercontent.com/u/40765189?v=4","gravatar_id":"","url":"https://api.github.com/users/mitresh95","html_url":"https://github.com/mitresh95","followers_url":"https://api.github.com/users/mitresh95/followers","following_url":"https://api.github.com/users/mitresh95/following{/other_user}","gists_url":"https://api.github.com/users/mitresh95/gists{/gist_id}","starred_url":"https://api.github.com/users/mitresh95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitresh95/subscriptions","organizations_url":"https://api.github.com/users/mitresh95/orgs","repos_url":"https://api.github.com/users/mitresh95/repos","events_url":"https://api.github.com/users/mitresh95/events{/privacy}","received_events_url":"https://api.github.com/users/mitresh95/received_events","type":"User","site_admin":false},"body":"[//]: # ( Please answer the following questions: )\r\n\r\n| Q  | A\r\n| --- | ---\r\n| Bug fix? | Y\r\n| New feature? | \r\n| Automated tests included? |\r\n| Related user documentation PR URL | \r\n| Related developer documentation PR URL | \r\n| Issues addressed (#s or URLs) | \r\n| BC breaks? | \r\n| Deprecations? | \r\n\r\n[//]: # ( Note that all new features should have a related user and/or developer documentation PR in their respective repositories. )\r\n\r\n[//]: # ( Required: )\r\n#### Description:\r\n\r\nThe subquery that includes contacts that were manually added to the included segment used exists which had a huge CPU performance hit on the database server. This changes that query to be an IN instead which resulted in significant speed and performance. \r\n\r\n[//]: # ( As applicable: )\r\n#### Steps to reproduce the bug:\r\n1. Difficult to reproduce unless you are using a heavy database server.\r\n\r\n#### Steps to test this PR:\r\n1. Ensure that manually added contacts to included segments are also included in the parent segment.\r\n2. Create Segment A that has a filter that will add several contacts\r\n3. Create Segment B that includes Segment A\r\n4. All of Segment A should have been added to Segment B\r\n5. Now go to a contact that is NOT in Segment A and manually add them to it.\r\n6. The contact should have been added to Segment B\r\n7. Remove the contact from Segment A and they should be removed from Segment B\r\n","created_at":"2018-09-13T21:56:20Z","updated_at":"2018-10-04T09:40:14Z","closed_at":"2018-10-04T09:40:14Z","merged_at":"2018-10-04T09:40:14Z","merge_commit_sha":"b8996ff169606b0a9cfbddf0820e929b3c0e4a4f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":154414515,"node_id":"MDU6TGFiZWwxNTQ0MTQ1MTU=","url":"https://api.github.com/repos/mautic/mautic/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":185161473,"node_id":"MDU6TGFiZWwxODUxNjE0NzM=","url":"https://api.github.com/repos/mautic/mautic/labels/Ready%20To%20Commit","name":"Ready To Commit","color":"60b044","default":false}],"milestone":{"url":"https://api.github.com/repos/mautic/mautic/milestones/48","html_url":"https://github.com/mautic/mautic/milestone/48","labels_url":"https://api.github.com/repos/mautic/mautic/milestones/48/labels","id":3624611,"node_id":"MDk6TWlsZXN0b25lMzYyNDYxMQ==","number":48,"title":"2.14.2","description":"Beta release is planed on Oct 16.","creator":{"login":"npracht","id":14075239,"node_id":"MDQ6VXNlcjE0MDc1MjM5","avatar_url":"https://avatars2.githubusercontent.com/u/14075239?v=4","gravatar_id":"","url":"https://api.github.com/users/npracht","html_url":"https://github.com/npracht","followers_url":"https://api.github.com/users/npracht/followers","following_url":"https://api.github.com/users/npracht/following{/other_user}","gists_url":"https://api.github.com/users/npracht/gists{/gist_id}","starred_url":"https://api.github.com/users/npracht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npracht/subscriptions","organizations_url":"https://api.github.com/users/npracht/orgs","repos_url":"https://api.github.com/users/npracht/repos","events_url":"https://api.github.com/users/npracht/events{/privacy}","received_events_url":"https://api.github.com/users/npracht/received_events","type":"User","site_admin":false},"open_issues":66,"closed_issues":39,"state":"open","created_at":"2018-09-05T13:39:45Z","updated_at":"2018-10-04T09:40:14Z","due_on":"2018-10-23T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mautic/mautic/pulls/6577/commits","review_comments_url":"https://api.github.com/repos/mautic/mautic/pulls/6577/comments","review_comment_url":"https://api.github.com/repos/mautic/mautic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mautic/mautic/issues/6577/comments","statuses_url":"https://api.github.com/repos/mautic/mautic/statuses/ee41039512fd5d605b9081affa6c002ef81f9c96","head":{"label":"mautic-inc:segments-manual-inclusion","ref":"segments-manual-inclusion","sha":"ee41039512fd5d605b9081affa6c002ef81f9c96","user":{"login":"mautic-inc","id":35141638,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MTQxNjM4","avatar_url":"https://avatars3.githubusercontent.com/u/35141638?v=4","gravatar_id":"","url":"https://api.github.com/users/mautic-inc","html_url":"https://github.com/mautic-inc","followers_url":"https://api.github.com/users/mautic-inc/followers","following_url":"https://api.github.com/users/mautic-inc/following{/other_user}","gists_url":"https://api.github.com/users/mautic-inc/gists{/gist_id}","starred_url":"https://api.github.com/users/mautic-inc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mautic-inc/subscriptions","organizations_url":"https://api.github.com/users/mautic-inc/orgs","repos_url":"https://api.github.com/users/mautic-inc/repos","events_url":"https://api.github.com/users/mautic-inc/events{/privacy}","received_events_url":"https://api.github.com/users/mautic-inc/received_events","type":"Organization","site_admin":false},"repo":{"id":135596276,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU1OTYyNzY=","name":"mautic","full_name":"mautic-inc/mautic","private":false,"owner":{"login":"mautic-inc","id":35141638,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MTQxNjM4","avatar_url":"https://avatars3.githubusercontent.com/u/35141638?v=4","gravatar_id":"","url":"https://api.github.com/users/mautic-inc","html_url":"https://github.com/mautic-inc","followers_url":"https://api.github.com/users/mautic-inc/followers","following_url":"https://api.github.com/users/mautic-inc/following{/other_user}","gists_url":"https://api.github.com/users/mautic-inc/gists{/gist_id}","starred_url":"https://api.github.com/users/mautic-inc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mautic-inc/subscriptions","organizations_url":"https://api.github.com/users/mautic-inc/orgs","repos_url":"https://api.github.com/users/mautic-inc/repos","events_url":"https://api.github.com/users/mautic-inc/events{/privacy}","received_events_url":"https://api.github.com/users/mautic-inc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mautic-inc/mautic","description":"Mautic: Open Source Marketing Automation Software.","fork":true,"url":"https://api.github.com/repos/mautic-inc/mautic","forks_url":"https://api.github.com/repos/mautic-inc/mautic/forks","keys_url":"https://api.github.com/repos/mautic-inc/mautic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mautic-inc/mautic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mautic-inc/mautic/teams","hooks_url":"https://api.github.com/repos/mautic-inc/mautic/hooks","issue_events_url":"https://api.github.com/repos/mautic-inc/mautic/issues/events{/number}","events_url":"https://api.github.com/repos/mautic-inc/mautic/events","assignees_url":"https://api.github.com/repos/mautic-inc/mautic/assignees{/user}","branches_url":"https://api.github.com/repos/mautic-inc/mautic/branches{/branch}","tags_url":"https://api.github.com/repos/mautic-inc/mautic/tags","blobs_url":"https://api.github.com/repos/mautic-inc/mautic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mautic-inc/mautic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mautic-inc/mautic/git/refs{/sha}","trees_url":"https://api.github.com/repos/mautic-inc/mautic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mautic-inc/mautic/statuses/{sha}","languages_url":"https://api.github.com/repos/mautic-inc/mautic/languages","stargazers_url":"https://api.github.com/repos/mautic-inc/mautic/stargazers","contributors_url":"https://api.github.com/repos/mautic-inc/mautic/contributors","subscribers_url":"https://api.github.com/repos/mautic-inc/mautic/subscribers","subscription_url":"https://api.github.com/repos/mautic-inc/mautic/subscription","commits_url":"https://api.github.com/repos/mautic-inc/mautic/commits{/sha}","git_commits_url":"https://api.github.com/repos/mautic-inc/mautic/git/commits{/sha}","comments_url":"https://api.github.com/repos/mautic-inc/mautic/comments{/number}","issue_comment_url":"https://api.github.com/repos/mautic-inc/mautic/issues/comments{/number}","contents_url":"https://api.github.com/repos/mautic-inc/mautic/contents/{+path}","compare_url":"https://api.github.com/repos/mautic-inc/mautic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mautic-inc/mautic/merges","archive_url":"https://api.github.com/repos/mautic-inc/mautic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mautic-inc/mautic/downloads","issues_url":"https://api.github.com/repos/mautic-inc/mautic/issues{/number}","pulls_url":"https://api.github.com/repos/mautic-inc/mautic/pulls{/number}","milestones_url":"https://api.github.com/repos/mautic-inc/mautic/milestones{/number}","notifications_url":"https://api.github.com/repos/mautic-inc/mautic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mautic-inc/mautic/labels{/name}","releases_url":"https://api.github.com/repos/mautic-inc/mautic/releases{/id}","deployments_url":"https://api.github.com/repos/mautic-inc/mautic/deployments","created_at":"2018-05-31T14:41:04Z","updated_at":"2018-10-03T09:21:23Z","pushed_at":"2018-10-03T09:21:21Z","git_url":"git://github.com/mautic-inc/mautic.git","ssh_url":"git@github.com:mautic-inc/mautic.git","clone_url":"https://github.com/mautic-inc/mautic.git","svn_url":"https://github.com/mautic-inc/mautic","homepage":"https://www.mautic.org","size":83182,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"staging"}},"base":{"label":"mautic:staging","ref":"staging","sha":"b9437d3259ef9327aba659b872af4f9cf116d886","user":{"login":"mautic","id":5257677,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyNTc2Nzc=","avatar_url":"https://avatars0.githubusercontent.com/u/5257677?v=4","gravatar_id":"","url":"https://api.github.com/users/mautic","html_url":"https://github.com/mautic","followers_url":"https://api.github.com/users/mautic/followers","following_url":"https://api.github.com/users/mautic/following{/other_user}","gists_url":"https://api.github.com/users/mautic/gists{/gist_id}","starred_url":"https://api.github.com/users/mautic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mautic/subscriptions","organizations_url":"https://api.github.com/users/mautic/orgs","repos_url":"https://api.github.com/users/mautic/repos","events_url":"https://api.github.com/users/mautic/events{/privacy}","received_events_url":"https://api.github.com/users/mautic/received_events","type":"Organization","site_admin":false},"repo":{"id":12204147,"node_id":"MDEwOlJlcG9zaXRvcnkxMjIwNDE0Nw==","name":"mautic","full_name":"mautic/mautic","private":false,"owner":{"login":"mautic","id":5257677,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyNTc2Nzc=","avatar_url":"https://avatars0.githubusercontent.com/u/5257677?v=4","gravatar_id":"","url":"https://api.github.com/users/mautic","html_url":"https://github.com/mautic","followers_url":"https://api.github.com/users/mautic/followers","following_url":"https://api.github.com/users/mautic/following{/other_user}","gists_url":"https://api.github.com/users/mautic/gists{/gist_id}","starred_url":"https://api.github.com/users/mautic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mautic/subscriptions","organizations_url":"https://api.github.com/users/mautic/orgs","repos_url":"https://api.github.com/users/mautic/repos","events_url":"https://api.github.com/users/mautic/events{/privacy}","received_events_url":"https://api.github.com/users/mautic/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mautic/mautic","description":"Mautic: Open Source Marketing Automation Software.","fork":false,"url":"https://api.github.com/repos/mautic/mautic","forks_url":"https://api.github.com/repos/mautic/mautic/forks","keys_url":"https://api.github.com/repos/mautic/mautic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mautic/mautic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mautic/mautic/teams","hooks_url":"https://api.github.com/repos/mautic/mautic/hooks","issue_events_url":"https://api.github.com/repos/mautic/mautic/issues/events{/number}","events_url":"https://api.github.com/repos/mautic/mautic/events","assignees_url":"https://api.github.com/repos/mautic/mautic/assignees{/user}","branches_url":"https://api.github.com/repos/mautic/mautic/branches{/branch}","tags_url":"https://api.github.com/repos/mautic/mautic/tags","blobs_url":"https://api.github.com/repos/mautic/mautic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mautic/mautic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mautic/mautic/git/refs{/sha}","trees_url":"https://api.github.com/repos/mautic/mautic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mautic/mautic/statuses/{sha}","languages_url":"https://api.github.com/repos/mautic/mautic/languages","stargazers_url":"https://api.github.com/repos/mautic/mautic/stargazers","contributors_url":"https://api.github.com/repos/mautic/mautic/contributors","subscribers_url":"https://api.github.com/repos/mautic/mautic/subscribers","subscription_url":"https://api.github.com/repos/mautic/mautic/subscription","commits_url":"https://api.github.com/repos/mautic/mautic/commits{/sha}","git_commits_url":"https://api.github.com/repos/mautic/mautic/git/commits{/sha}","comments_url":"https://api.github.com/repos/mautic/mautic/comments{/number}","issue_comment_url":"https://api.github.com/repos/mautic/mautic/issues/comments{/number}","contents_url":"https://api.github.com/repos/mautic/mautic/contents/{+path}","compare_url":"https://api.github.com/repos/mautic/mautic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mautic/mautic/merges","archive_url":"https://api.github.com/repos/mautic/mautic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mautic/mautic/downloads","issues_url":"https://api.github.com/repos/mautic/mautic/issues{/number}","pulls_url":"https://api.github.com/repos/mautic/mautic/pulls{/number}","milestones_url":"https://api.github.com/repos/mautic/mautic/milestones{/number}","notifications_url":"https://api.github.com/repos/mautic/mautic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mautic/mautic/labels{/name}","releases_url":"https://api.github.com/repos/mautic/mautic/releases{/id}","deployments_url":"https://api.github.com/repos/mautic/mautic/deployments","created_at":"2013-08-19T00:36:28Z","updated_at":"2018-10-04T09:39:34Z","pushed_at":"2018-10-04T09:40:14Z","git_url":"git://github.com/mautic/mautic.git","ssh_url":"git@github.com:mautic/mautic.git","clone_url":"https://github.com/mautic/mautic.git","svn_url":"https://github.com/mautic/mautic","homepage":"https://www.mautic.org","size":83019,"stargazers_count":2714,"watchers_count":2714,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":988,"mirror_url":null,"archived":false,"open_issues_count":788,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":988,"open_issues":788,"watchers":2714,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/mautic/mautic/pulls/6577"},"html":{"href":"https://github.com/mautic/mautic/pull/6577"},"issue":{"href":"https://api.github.com/repos/mautic/mautic/issues/6577"},"comments":{"href":"https://api.github.com/repos/mautic/mautic/issues/6577/comments"},"review_comments":{"href":"https://api.github.com/repos/mautic/mautic/pulls/6577/comments"},"review_comment":{"href":"https://api.github.com/repos/mautic/mautic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mautic/mautic/pulls/6577/commits"},"statuses":{"href":"https://api.github.com/repos/mautic/mautic/statuses/ee41039512fd5d605b9081affa6c002ef81f9c96"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"escopecz","id":1235442,"node_id":"MDQ6VXNlcjEyMzU0NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1235442?v=4","gravatar_id":"","url":"https://api.github.com/users/escopecz","html_url":"https://github.com/escopecz","followers_url":"https://api.github.com/users/escopecz/followers","following_url":"https://api.github.com/users/escopecz/following{/other_user}","gists_url":"https://api.github.com/users/escopecz/gists{/gist_id}","starred_url":"https://api.github.com/users/escopecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escopecz/subscriptions","organizations_url":"https://api.github.com/users/escopecz/orgs","repos_url":"https://api.github.com/users/escopecz/repos","events_url":"https://api.github.com/users/escopecz/events{/privacy}","received_events_url":"https://api.github.com/users/escopecz/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":1,"deletions":2,"changed_files":1}}
{"actor":{"display_login":"escopecz"}}