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 35E3D200C2C for ; Fri, 3 Mar 2017 23:10:53 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 346F9160B5E; Fri, 3 Mar 2017 22:10:53 +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 868C1160B80 for ; Fri, 3 Mar 2017 23:10:52 +0100 (CET) Received: (qmail 48088 invoked by uid 500); 3 Mar 2017 22:10:51 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 48079 invoked by uid 99); 3 Mar 2017 22:10:51 -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; Fri, 03 Mar 2017 22:10:51 +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 3C7AFC0445 for ; Fri, 3 Mar 2017 22:10:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.451 X-Spam-Level: * X-Spam-Status: No, score=1.451 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] 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 UFAfobWbkVNQ for ; Fri, 3 Mar 2017 22:10:50 +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 C973A618B0 for ; Fri, 3 Mar 2017 22:10:49 +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 83904E0BD0 for ; Fri, 3 Mar 2017 22:10:47 +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 93E1D24196 for ; Fri, 3 Mar 2017 22:10:46 +0000 (UTC) Date: Fri, 3 Mar 2017 22:10:46 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5293) Poor performance of Hash Table due to same hash value as distribution below MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 03 Mar 2017 22:10:53 -0000 [ https://issues.apache.org/jira/browse/DRILL-5293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15895118#comment-15895118 ] ASF GitHub Bot commented on DRILL-5293: --------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/drill/pull/765 > Poor performance of Hash Table due to same hash value as distribution below > --------------------------------------------------------------------------- > > Key: DRILL-5293 > URL: https://issues.apache.org/jira/browse/DRILL-5293 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Codegen > Affects Versions: 1.8.0 > Reporter: Boaz Ben-Zvi > Assignee: Boaz Ben-Zvi > Labels: ready-to-commit > > The computation of the hash value is basically the same whether for the Hash Table (used by Hash Agg, and Hash Join), or for distribution of rows at the exchange. As a result, a specific Hash Table (in a parallel minor fragment) gets only rows "filtered out" by the partition below ("upstream"), so the pattern of this filtering leads to a non uniform usage of the hash buckets in the table. > Here is a simplified example: An exchange partitions into TWO (minor fragments), each running a Hash Agg. So the partition sends rows of EVEN hash values to the first, and rows of ODD hash values to the second. Now the first recomputes the _same_ hash value for its Hash table -- and only the even buckets get used !! (Or with a partition into EIGHT -- possibly only one eighth of the buckets would be used !! ) > This would lead to longer hash chains and thus a _poor performance_ ! > A possible solution -- add a distribution function distFunc (only for partitioning) that takes the hash value and "scrambles" it so that the entropy in all the bits effects the low bits of the output. This function should be applied (in HashPrelUtil) over the generated code that produces the hash value, like: > distFunc( hash32(field1, hash32(field2, hash32(field3, 0))) ); > Tested with a huge hash aggregate (64 M rows) and a parallelism of 8 ( planner.width.max_per_node = 8 ); minor fragments 0 and 4 used only 1/8 of their buckets, the others used 1/4 of their buckets. Maybe the reason for this variance is that distribution is using "hash32AsDouble" and hash agg is using "hash32". -- This message was sent by Atlassian JIRA (v6.3.15#6346)