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 848D8200CD2 for ; Thu, 27 Jul 2017 09:14:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 82F9216A611; Thu, 27 Jul 2017 07:14:05 +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 C8BC616A610 for ; Thu, 27 Jul 2017 09:14:04 +0200 (CEST) Received: (qmail 39766 invoked by uid 500); 27 Jul 2017 07:14:04 -0000 Mailing-List: contact issues-help@carbondata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@carbondata.apache.org Delivered-To: mailing list issues@carbondata.apache.org Received: (qmail 39757 invoked by uid 99); 27 Jul 2017 07:14:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jul 2017 07:14:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 771CB180371 for ; Thu, 27 Jul 2017 07:14:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id zMMKKbtqgwT3 for ; Thu, 27 Jul 2017 07:14:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D0EAB5FBC0 for ; Thu, 27 Jul 2017 07:14:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 942C2E01D8 for ; Thu, 27 Jul 2017 07:14:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4630A21ED9 for ; Thu, 27 Jul 2017 07:14:00 +0000 (UTC) Date: Thu, 27 Jul 2017 07:14:00 +0000 (UTC) From: "xuchuanyin (JIRA)" To: issues@carbondata.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CARBONDATA-1335) Duplicated & time-consuming method call found in query MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 27 Jul 2017 07:14:05 -0000 [ https://issues.apache.org/jira/browse/CARBONDATA-1335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] xuchuanyin updated CARBONDATA-1335: ----------------------------------- Description: # Scenario Currently we did a concurrent 14 queries on Carbondata. The queries are the same, but on different tables. We have noticed the following scene: + A single query took about 5s; + In concurrent scenario, each query took about 15s; By adding checkpoint in the log, we found that there was great latency in starting query jobs in spark. # Analyze When we fire a query, Carbondata firstly do some job in the client side, including parse/analyze plans and prepare filtered blocks and inputSplits. Then Carbondata start to submit query job to spark. We found in the first step, Carbondata took about 7s in current scenario, but it only took about <1s in single scenario. By studying the related code, we found the most time consuming method call was `CarbonSessionCatalog.lookupRelation`. In side this method, it called `super.lookupRelation` twice, which consumed about 3s each time. # Solution Carbondata only needs to call the `super.lookupRelation` only once, we need to remove the useless duplicated method call. I've tested in my environment and it works well. In concurrent scenario, each query takes about 12s (3s saved for the improvement). was: # Scenario Currently we did a concurrent 14 queries on Carbondata. The queries are the same, but on different tables. We have noticed the following scene: + A single query took about 5s; + In concurrent scenario, each query took about 15s; By adding checkpoint in the log, we found that there was great latency in starting query jobs in spark. # Analysts When we fire a query, Carbondata firstly do some job in the client side, including parse/analyze plans and prepare filtered blocks and inputSplits. Then Carbondata start to submit query job to spark. We found in the first step, Carbondata took about 7s in current scenario, but it only took about <1s in single scenario. By studying the related code, we found the most time consuming method call was `CarbonSessionCatalog.lookupRelation`. In side this method, it called `super.lookupRelation` twice, which consumed about 3s each time. # Solution Carbondata only needs to call the `super.lookupRelation` only once, we need to remove the useless duplicated method call. I've tested in my environment and it works well. In concurrent scenario, each query takes about 12s (3s saved for the improvement). > Duplicated & time-consuming method call found in query > ------------------------------------------------------ > > Key: CARBONDATA-1335 > URL: https://issues.apache.org/jira/browse/CARBONDATA-1335 > Project: CarbonData > Issue Type: Improvement > Components: data-query > Affects Versions: 1.1.1 > Reporter: xuchuanyin > Priority: Minor > Labels: performance > Time Spent: 40m > Remaining Estimate: 0h > > # Scenario > Currently we did a concurrent 14 queries on Carbondata. The queries are the same, but on different tables. We have noticed the following scene: > + A single query took about 5s; > + In concurrent scenario, each query took about 15s; > By adding checkpoint in the log, we found that there was great latency in starting query jobs in spark. > # Analyze > When we fire a query, Carbondata firstly do some job in the client side, including parse/analyze plans and prepare filtered blocks and inputSplits. Then Carbondata start to submit query job to spark. > We found in the first step, Carbondata took about 7s in current scenario, but it only took about <1s in single scenario. > By studying the related code, we found the most time consuming method call was `CarbonSessionCatalog.lookupRelation`. In side this method, it called `super.lookupRelation` twice, which consumed about 3s each time. > # Solution > Carbondata only needs to call the `super.lookupRelation` only once, we need to remove the useless duplicated method call. > I've tested in my environment and it works well. In concurrent scenario, each query takes about 12s (3s saved for the improvement). -- This message was sent by Atlassian JIRA (v6.4.14#64029)