Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 98AA0200B24 for ; Wed, 18 May 2016 03:08:17 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9761F1609F5; Wed, 18 May 2016 01:08:17 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E8BC1160A20 for ; Wed, 18 May 2016 03:08:16 +0200 (CEST) Received: (qmail 18129 invoked by uid 500); 18 May 2016 01:08:15 -0000 Mailing-List: contact commits-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list commits@hawq.incubator.apache.org Received: (qmail 18076 invoked by uid 99); 18 May 2016 01:08:15 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2016 01:08:15 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A8DDDC7599 for ; Wed, 18 May 2016 01:08:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id UJVZvpJT4np4 for ; Wed, 18 May 2016 01:08:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 0FDD75F4E3 for ; Wed, 18 May 2016 01:08:11 +0000 (UTC) Received: (qmail 14966 invoked by uid 99); 18 May 2016 01:08:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2016 01:08:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 306AADFDCF; Wed, 18 May 2016 01:08:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: huor@apache.org To: commits@hawq.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) archived-at: Wed, 18 May 2016 01:08:17 -0000 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 Authored: Tue May 17 14:52:39 2016 +0800 Committer: Ruilong Huo 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 */ } } }