{"action":"created","comment":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments/139197165","pull_request_review_id":63099453,"id":139197165,"diff_hunk":"@@ -2170,7 +2172,12 @@ uint64 PlanStateOperatorMemKB(const PlanState *ps)\n \t}\n \telse\n \t{\n-\t\tresult = ps->plan->operatorMemKB;\n+\t\tif (memory_profiler_dataset_size == 1000 && IsMemoryIntensiveOperator((Node *)ps->plan, ps->state->es_plannedstmt))","path":"src/backend/executor/execUtils.c","position":14,"original_position":14,"commit_id":"5d21ed6088a2fd92135afbfd253babb17070be69","original_commit_id":"22458996efa1fac154096189e02779dcf1edf184","user":{"login":"kavinderd","id":449917,"avatar_url":"https://avatars0.githubusercontent.com/u/449917?v=4","gravatar_id":"","url":"https://api.github.com/users/kavinderd","html_url":"https://github.com/kavinderd","followers_url":"https://api.github.com/users/kavinderd/followers","following_url":"https://api.github.com/users/kavinderd/following{/other_user}","gists_url":"https://api.github.com/users/kavinderd/gists{/gist_id}","starred_url":"https://api.github.com/users/kavinderd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavinderd/subscriptions","organizations_url":"https://api.github.com/users/kavinderd/orgs","repos_url":"https://api.github.com/users/kavinderd/repos","events_url":"https://api.github.com/users/kavinderd/events{/privacy}","received_events_url":"https://api.github.com/users/kavinderd/received_events","type":"User","site_admin":false},"body":"It's just an arbitrary guc we used to guard the feature while developing. It'll be removed before merging","created_at":"2017-09-15T16:45:37Z","updated_at":"2017-09-15T16:45:37Z","html_url":"https://github.com/greenplum-db/gpdb/pull/3277#discussion_r139197165","pull_request_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/3277","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments/139197165"},"html":{"href":"https://github.com/greenplum-db/gpdb/pull/3277#discussion_r139197165"},"pull_request":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/3277"}},"in_reply_to_id":138811441},"pull_request":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/3277","id":140936356,"html_url":"https://github.com/greenplum-db/gpdb/pull/3277","diff_url":"https://github.com/greenplum-db/gpdb/pull/3277.diff","patch_url":"https://github.com/greenplum-db/gpdb/pull/3277.patch","issue_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/3277","number":3277,"state":"open","locked":false,"title":"Dynamic operator memory","user":{"login":"kavinderd","id":449917,"avatar_url":"https://avatars0.githubusercontent.com/u/449917?v=4","gravatar_id":"","url":"https://api.github.com/users/kavinderd","html_url":"https://github.com/kavinderd","followers_url":"https://api.github.com/users/kavinderd/followers","following_url":"https://api.github.com/users/kavinderd/following{/other_user}","gists_url":"https://api.github.com/users/kavinderd/gists{/gist_id}","starred_url":"https://api.github.com/users/kavinderd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavinderd/subscriptions","organizations_url":"https://api.github.com/users/kavinderd/orgs","repos_url":"https://api.github.com/users/kavinderd/repos","events_url":"https://api.github.com/users/kavinderd/events{/privacy}","received_events_url":"https://api.github.com/users/kavinderd/received_events","type":"User","site_admin":false},"body":"There are cases where during execution a Memory Intensive Operator (MI)\r\nmay not use all the memory that is allocated to it. This means that this\r\nextra memory (quota - allocated) can be relinquished for other MI nodes\r\nto use during execution of a statement. For example\r\n\r\n````\r\n->  Hash Join\r\n         ->  HashAggregate\r\n         ->  Hash\r\n````\r\n\r\nIn the above query fragment the HashJoin operator has a MI operator for\r\nboth its inner and outer subtree. If there ever is the case that the\r\nHash node used much less memory than was given as its quota it will now\r\ncall MemoryAccounting_DeclareDone() and the difference between its\r\nquota and allocated amount will be added to the allocated amount of the\r\nRelinquishedPool. Doing this will enable HashAggregate to request memory\r\nfrom this RelinquishedPool if it exhausts its quota to prevent spilling.\r\n\r\nThis PR adds two new API's to the MemoryAccounting Framework\r\n\r\n`MemoryAccounting_DeclareDone()`: Add the difference between a memory account's quota and its allocated amount to the long living RelinquishedPool\r\n`MemoryAccounting_RequestQuotaIncrease()`: Retrieve all relinquished memory by incrementing an operator's `operatorMemKb` and setting the RelinquishedPool to 0\r\n\r\nNote: This PR introduces the facility for Hash to relinquish memory to the RelinquishedPool memory account and for the Agg operator (specifically HashAgg) to request an\r\nincrease to its quota before it builds its hash table. This commit does\r\nnot generally apply this paradigm to all MI operators","created_at":"2017-09-13T21:38:07Z","updated_at":"2017-09-15T16:45:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1604a1b52eb413492adbedae8a5938eade0c7bc6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"melanieplageman","id":165995,"avatar_url":"https://avatars0.githubusercontent.com/u/165995?v=4","gravatar_id":"","url":"https://api.github.com/users/melanieplageman","html_url":"https://github.com/melanieplageman","followers_url":"https://api.github.com/users/melanieplageman/followers","following_url":"https://api.github.com/users/melanieplageman/following{/other_user}","gists_url":"https://api.github.com/users/melanieplageman/gists{/gist_id}","starred_url":"https://api.github.com/users/melanieplageman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melanieplageman/subscriptions","organizations_url":"https://api.github.com/users/melanieplageman/orgs","repos_url":"https://api.github.com/users/melanieplageman/repos","events_url":"https://api.github.com/users/melanieplageman/events{/privacy}","received_events_url":"https://api.github.com/users/melanieplageman/received_events","type":"User","site_admin":false},{"login":"hlinnaka","id":191602,"avatar_url":"https://avatars2.githubusercontent.com/u/191602?v=4","gravatar_id":"","url":"https://api.github.com/users/hlinnaka","html_url":"https://github.com/hlinnaka","followers_url":"https://api.github.com/users/hlinnaka/followers","following_url":"https://api.github.com/users/hlinnaka/following{/other_user}","gists_url":"https://api.github.com/users/hlinnaka/gists{/gist_id}","starred_url":"https://api.github.com/users/hlinnaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlinnaka/subscriptions","organizations_url":"https://api.github.com/users/hlinnaka/orgs","repos_url":"https://api.github.com/users/hlinnaka/repos","events_url":"https://api.github.com/users/hlinnaka/events{/privacy}","received_events_url":"https://api.github.com/users/hlinnaka/received_events","type":"User","site_admin":false},{"login":"d","id":440892,"avatar_url":"https://avatars2.githubusercontent.com/u/440892?v=4","gravatar_id":"","url":"https://api.github.com/users/d","html_url":"https://github.com/d","followers_url":"https://api.github.com/users/d/followers","following_url":"https://api.github.com/users/d/following{/other_user}","gists_url":"https://api.github.com/users/d/gists{/gist_id}","starred_url":"https://api.github.com/users/d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d/subscriptions","organizations_url":"https://api.github.com/users/d/orgs","repos_url":"https://api.github.com/users/d/repos","events_url":"https://api.github.com/users/d/events{/privacy}","received_events_url":"https://api.github.com/users/d/received_events","type":"User","site_admin":false},{"login":"hardikar","id":2496677,"avatar_url":"https://avatars2.githubusercontent.com/u/2496677?v=4","gravatar_id":"","url":"https://api.github.com/users/hardikar","html_url":"https://github.com/hardikar","followers_url":"https://api.github.com/users/hardikar/followers","following_url":"https://api.github.com/users/hardikar/following{/other_user}","gists_url":"https://api.github.com/users/hardikar/gists{/gist_id}","starred_url":"https://api.github.com/users/hardikar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardikar/subscriptions","organizations_url":"https://api.github.com/users/hardikar/orgs","repos_url":"https://api.github.com/users/hardikar/repos","events_url":"https://api.github.com/users/hardikar/events{/privacy}","received_events_url":"https://api.github.com/users/hardikar/received_events","type":"User","site_admin":false},{"login":"sambitesh","id":8096768,"avatar_url":"https://avatars0.githubusercontent.com/u/8096768?v=4","gravatar_id":"","url":"https://api.github.com/users/sambitesh","html_url":"https://github.com/sambitesh","followers_url":"https://api.github.com/users/sambitesh/followers","following_url":"https://api.github.com/users/sambitesh/following{/other_user}","gists_url":"https://api.github.com/users/sambitesh/gists{/gist_id}","starred_url":"https://api.github.com/users/sambitesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sambitesh/subscriptions","organizations_url":"https://api.github.com/users/sambitesh/orgs","repos_url":"https://api.github.com/users/sambitesh/repos","events_url":"https://api.github.com/users/sambitesh/events{/privacy}","received_events_url":"https://api.github.com/users/sambitesh/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/3277/commits","review_comments_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/3277/comments","review_comment_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/3277/comments","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/5d21ed6088a2fd92135afbfd253babb17070be69","head":{"label":"kavinderd:dynamic_operator_memory","ref":"dynamic_operator_memory","sha":"5d21ed6088a2fd92135afbfd253babb17070be69","user":{"login":"kavinderd","id":449917,"avatar_url":"https://avatars0.githubusercontent.com/u/449917?v=4","gravatar_id":"","url":"https://api.github.com/users/kavinderd","html_url":"https://github.com/kavinderd","followers_url":"https://api.github.com/users/kavinderd/followers","following_url":"https://api.github.com/users/kavinderd/following{/other_user}","gists_url":"https://api.github.com/users/kavinderd/gists{/gist_id}","starred_url":"https://api.github.com/users/kavinderd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavinderd/subscriptions","organizations_url":"https://api.github.com/users/kavinderd/orgs","repos_url":"https://api.github.com/users/kavinderd/repos","events_url":"https://api.github.com/users/kavinderd/events{/privacy}","received_events_url":"https://api.github.com/users/kavinderd/received_events","type":"User","site_admin":false},"repo":{"id":90416368,"name":"gpdb","full_name":"kavinderd/gpdb","owner":{"login":"kavinderd","id":449917,"avatar_url":"https://avatars0.githubusercontent.com/u/449917?v=4","gravatar_id":"","url":"https://api.github.com/users/kavinderd","html_url":"https://github.com/kavinderd","followers_url":"https://api.github.com/users/kavinderd/followers","following_url":"https://api.github.com/users/kavinderd/following{/other_user}","gists_url":"https://api.github.com/users/kavinderd/gists{/gist_id}","starred_url":"https://api.github.com/users/kavinderd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavinderd/subscriptions","organizations_url":"https://api.github.com/users/kavinderd/orgs","repos_url":"https://api.github.com/users/kavinderd/repos","events_url":"https://api.github.com/users/kavinderd/events{/privacy}","received_events_url":"https://api.github.com/users/kavinderd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kavinderd/gpdb","description":"Greenplum Database","fork":true,"url":"https://api.github.com/repos/kavinderd/gpdb","forks_url":"https://api.github.com/repos/kavinderd/gpdb/forks","keys_url":"https://api.github.com/repos/kavinderd/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kavinderd/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kavinderd/gpdb/teams","hooks_url":"https://api.github.com/repos/kavinderd/gpdb/hooks","issue_events_url":"https://api.github.com/repos/kavinderd/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/kavinderd/gpdb/events","assignees_url":"https://api.github.com/repos/kavinderd/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/kavinderd/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/kavinderd/gpdb/tags","blobs_url":"https://api.github.com/repos/kavinderd/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kavinderd/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kavinderd/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/kavinderd/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kavinderd/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/kavinderd/gpdb/languages","stargazers_url":"https://api.github.com/repos/kavinderd/gpdb/stargazers","contributors_url":"https://api.github.com/repos/kavinderd/gpdb/contributors","subscribers_url":"https://api.github.com/repos/kavinderd/gpdb/subscribers","subscription_url":"https://api.github.com/repos/kavinderd/gpdb/subscription","commits_url":"https://api.github.com/repos/kavinderd/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/kavinderd/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/kavinderd/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/kavinderd/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/kavinderd/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/kavinderd/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kavinderd/gpdb/merges","archive_url":"https://api.github.com/repos/kavinderd/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kavinderd/gpdb/downloads","issues_url":"https://api.github.com/repos/kavinderd/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/kavinderd/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/kavinderd/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/kavinderd/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kavinderd/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/kavinderd/gpdb/releases{/id}","deployments_url":"https://api.github.com/repos/kavinderd/gpdb/deployments","created_at":"2017-05-05T21:07:36Z","updated_at":"2017-05-05T21:08:23Z","pushed_at":"2017-09-15T00:01:06Z","git_url":"git://github.com/kavinderd/gpdb.git","ssh_url":"git@github.com:kavinderd/gpdb.git","clone_url":"https://github.com/kavinderd/gpdb.git","svn_url":"https://github.com/kavinderd/gpdb","homepage":"http://greenplum.org","size":219359,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"greenplum-db:master","ref":"master","sha":"8cc820d3cd10f49ed9a943df8c74fe1200da2903","user":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars2.githubusercontent.com/u/14097842?v=4","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":44781140,"name":"gpdb","full_name":"greenplum-db/gpdb","owner":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars2.githubusercontent.com/u/14097842?v=4","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/gpdb","description":"Greenplum Database","fork":false,"url":"https://api.github.com/repos/greenplum-db/gpdb","forks_url":"https://api.github.com/repos/greenplum-db/gpdb/forks","keys_url":"https://api.github.com/repos/greenplum-db/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greenplum-db/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greenplum-db/gpdb/teams","hooks_url":"https://api.github.com/repos/greenplum-db/gpdb/hooks","issue_events_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/greenplum-db/gpdb/events","assignees_url":"https://api.github.com/repos/greenplum-db/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/greenplum-db/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/greenplum-db/gpdb/tags","blobs_url":"https://api.github.com/repos/greenplum-db/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greenplum-db/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greenplum-db/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/greenplum-db/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/greenplum-db/gpdb/languages","stargazers_url":"https://api.github.com/repos/greenplum-db/gpdb/stargazers","contributors_url":"https://api.github.com/repos/greenplum-db/gpdb/contributors","subscribers_url":"https://api.github.com/repos/greenplum-db/gpdb/subscribers","subscription_url":"https://api.github.com/repos/greenplum-db/gpdb/subscription","commits_url":"https://api.github.com/repos/greenplum-db/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/greenplum-db/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/greenplum-db/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/greenplum-db/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greenplum-db/gpdb/merges","archive_url":"https://api.github.com/repos/greenplum-db/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greenplum-db/gpdb/downloads","issues_url":"https://api.github.com/repos/greenplum-db/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/greenplum-db/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/greenplum-db/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greenplum-db/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/greenplum-db/gpdb/releases{/id}","deployments_url":"https://api.github.com/repos/greenplum-db/gpdb/deployments","created_at":"2015-10-23T00:25:17Z","updated_at":"2017-09-15T16:19:51Z","pushed_at":"2017-09-15T16:01:33Z","git_url":"git://github.com/greenplum-db/gpdb.git","ssh_url":"git@github.com:greenplum-db/gpdb.git","clone_url":"https://github.com/greenplum-db/gpdb.git","svn_url":"https://github.com/greenplum-db/gpdb","homepage":"http://greenplum.org","size":220121,"stargazers_count":2064,"watchers_count":2064,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":645,"mirror_url":null,"open_issues_count":161,"forks":645,"open_issues":161,"watchers":2064,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/3277"},"html":{"href":"https://github.com/greenplum-db/gpdb/pull/3277"},"issue":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/3277"},"comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/3277/comments"},"review_comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/3277/comments"},"review_comment":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/3277/commits"},"statuses":{"href":"https://api.github.com/repos/greenplum-db/gpdb/statuses/5d21ed6088a2fd92135afbfd253babb17070be69"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kavinderd"}}