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 806FC200C49 for ; Fri, 17 Mar 2017 22:28:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7F088160B80; Fri, 17 Mar 2017 21:28:46 +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 C96F7160B70 for ; Fri, 17 Mar 2017 22:28:45 +0100 (CET) Received: (qmail 68755 invoked by uid 500); 17 Mar 2017 21:28:45 -0000 Mailing-List: contact issues-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list issues@impala.incubator.apache.org Received: (qmail 68743 invoked by uid 99); 17 Mar 2017 21:28:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Mar 2017 21:28:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A78CDC8819 for ; Fri, 17 Mar 2017 21:28:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.651 X-Spam-Level: X-Spam-Status: No, score=0.651 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id DXjl80ERuYC1 for ; Fri, 17 Mar 2017 21:28:43 +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 63B9D5FD00 for ; Fri, 17 Mar 2017 21:28:43 +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 57861E08B9 for ; Fri, 17 Mar 2017 21:28:42 +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 98FC9254BA for ; Fri, 17 Mar 2017 21:28:41 +0000 (UTC) Date: Fri, 17 Mar 2017 21:28:41 +0000 (UTC) From: "Alexander Behm (JIRA)" To: issues@impala.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (IMPALA-5036) Improve COUNT(*) performance of Parquet scans. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 17 Mar 2017 21:28:46 -0000 [ https://issues.apache.org/jira/browse/IMPALA-5036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexander Behm updated IMPALA-5036: ----------------------------------- Description: {code} select count(*) from parquet_table; select count(*) from parquet_table group by partition_col; {code} Impala already has a special code path for fast Parquet scans when no columns are scanned and materialized, but the performance can be significantly improved with a plan+execution change, as follows: *Execution change* Instead of returning empty batches until num_rows have been returned, the Parquet scanner can populate a single slot with the num_rows from the Parquet row groups *Plan change* The count(*) local aggregation needs to be changed to a sum(num_rows_slot) aggregation. The final distributed plan will be: scan -> local agg with sum(num_rows_slot) -> merge agg sum(sum(num_rows_slot)) This optimization is applicable where is only a count(*) and there are no scan predicates. was: {code} select count(*) from parquet_table; select count(*) from parquet_table group by partition_col; {code} Impala already has a special code path for fast Parquet scans when no columns are scanned and materialized, but the performance can be significantly improved with a plan+execution change, as follows: Execution change: Instead of returning empty batches until num_rows have been returned, the Parquet scanner can populate a single slot with the num_rows from the Parquet row groups Plan change: The count(*) local aggregation needs to be changed to a sum(num_rows_slot) aggregation. The final distributed plan will be: scan -> local agg with sum(num_rows_slot) -> merge agg sum(sum(num_rows_slot)) This optimization is applicable where there is only count(*) and no scan predicates. > Improve COUNT(*) performance of Parquet scans. > ---------------------------------------------- > > Key: IMPALA-5036 > URL: https://issues.apache.org/jira/browse/IMPALA-5036 > Project: IMPALA > Issue Type: Sub-task > Components: Backend > Affects Versions: Impala 2.5.0, Impala 2.6.0, Impala 2.7.0, Impala 2.8.0 > Reporter: Alexander Behm > Labels: parquet, performance > > {code} > select count(*) from parquet_table; > select count(*) from parquet_table group by partition_col; > {code} > Impala already has a special code path for fast Parquet scans when no columns are scanned and materialized, but the performance can be significantly improved with a plan+execution change, as follows: > *Execution change* > Instead of returning empty batches until num_rows have been returned, the Parquet scanner can populate a single slot with the num_rows from the Parquet row groups > *Plan change* > The count(*) local aggregation needs to be changed to a sum(num_rows_slot) aggregation. > The final distributed plan will be: > scan -> local agg with sum(num_rows_slot) -> merge agg sum(sum(num_rows_slot)) > This optimization is applicable where is only a count(*) and there are no scan predicates. -- This message was sent by Atlassian JIRA (v6.3.15#6346)