hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject incubator-hawq git commit: HAWQ-738. Do not allocate query resource twice in function call through jdbc
Date Wed, 18 May 2016 01:08:11 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master cec472dca -> 3d3611ef8


HAWQ-738. Do not allocate query resource twice in function call through jdbc


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/3d3611ef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/3d3611ef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/3d3611ef

Branch: refs/heads/master
Commit: 3d3611ef80d246b446a9e403f91438395b4d856d
Parents: cec472d
Author: Ruilong Huo <rhuo@pivotal.io>
Authored: Tue May 17 14:52:39 2016 +0800
Committer: Ruilong Huo <rhuo@pivotal.io>
Committed: Tue May 17 15:12:12 2016 +0800

----------------------------------------------------------------------
 src/backend/optimizer/plan/planner.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3d3611ef/src/backend/optimizer/plan/planner.c
----------------------------------------------------------------------
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index ebad24f..ecc4ce6 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -543,14 +543,16 @@ resource_negotiator(Query *parse, int cursorOptions, ParamListInfo boundParams,
     }else{
     		find_udf(my_parse, &udf_context);
     		if(udf_context.udf_exist){
-    			if ((resourceLife == QRL_ONCE) || (resourceLife == QRL_NONE)) {
+    			if ((resourceLife == QRL_ONCE)) {
     				int64 mincost = min_cost_for_each_query;
     				mincost <<= 20;
     				int avgSliceNum = 3;
     				(*result)->saResult.resource = AllocateResource(QRL_ONCE, avgSliceNum, mincost,
     						GetUserDefinedFunctionVsegNum(),GetUserDefinedFunctionVsegNum(),NULL, 0);
-    			}else{
+    			} else if (resourceLife == QRL_INHERIT) {
     				(*result)->saResult.resource = AllocateResource(resourceLife, 0, 0, 0, 0, NULL,
0);
+    			} else {
+    				/* Do not allocate resource for query with resourceLife = QRL_NONE */
     			}
     		}
     }


Mime
View raw message