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 A6AEE200B44 for ; Thu, 14 Jul 2016 09:27:31 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A5297160A63; Thu, 14 Jul 2016 07:27:31 +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 EF7BA160A52 for ; Thu, 14 Jul 2016 09:27:30 +0200 (CEST) Received: (qmail 96300 invoked by uid 500); 14 Jul 2016 07:27:25 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 96289 invoked by uid 99); 14 Jul 2016 07:27:25 -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; Thu, 14 Jul 2016 07:27:25 +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 58FF8C0C77 for ; Thu, 14 Jul 2016 07:27:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -5.446 X-Spam-Level: X-Spam-Status: No, score=-5.446 tagged_above=-999 required=6.31 tests=[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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id zcxtZGaQqWeF for ; Thu, 14 Jul 2016 07:27:22 +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 69D985F24C for ; Thu, 14 Jul 2016 07:27:21 +0000 (UTC) Received: (qmail 96121 invoked by uid 99); 14 Jul 2016 07:27:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jul 2016 07:27:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8F0EF2C02A5 for ; Thu, 14 Jul 2016 07:27:20 +0000 (UTC) Date: Thu, 14 Jul 2016 07:27:20 +0000 (UTC) From: "Junegunn Choi (JIRA)" To: dev@phoenix.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-3073) Fast path for single-key point lookups MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 14 Jul 2016 07:27:31 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15376491#comment-15376491 ] Junegunn Choi commented on PHOENIX-3073: ---------------------------------------- I also found that the client overhead for this particular query was greatly increased recently due to the following change (PHOENIX-3040): https://github.com/apache/phoenix/commit/f9420e6fb8d635572a7049527db0cc513dbeebe6#diff-8c3d3f644c66ef36d5bc604f017fabfcL144 With the change, the query started to use guideposts (isPointLookup = true, plan.isSerial() = false) and it turns out to be quite costly on the client side. The client CPU usage for the same workload before PHOENIX-3040 is 22.3%. > Fast path for single-key point lookups > -------------------------------------- > > Key: PHOENIX-3073 > URL: https://issues.apache.org/jira/browse/PHOENIX-3073 > Project: Phoenix > Issue Type: Improvement > Reporter: Junegunn Choi > Assignee: Junegunn Choi > Attachments: PHOENIX-3073.patch > > > While comparing Phoenix JDBC client to the native HBase Java client, I noticed that Phoenix client uses significantly more CPU time on the client machine. Profiling revealed that the majority of the time was spent on {{BaseResultIterators.getParallelScans()}}. This was surprising to me as I was only testing with simple point lookup queries. > Here's how I tested: > - {{SELECT /*+ SMALL SERIAL */ ID, DOCID FROM IMAGE WHERE ID = ?}} > - {{IMAGE}} is a salted table with 100 salt buckets > - {{ID}}, the primary key, was randomly selected in a small range so that the requests are served without disk I/O > - 20K/sec concurrent requests using 128 threads > {{getParallelScans()}} is quite expensive as it iterates over all regions of the table which can be many, only to return a single Scan object for this query. Since such a single-key point lookup is one of the most frequent type of requests in a typical OLTP application, I believe it makes sense to have a fast path for it. With the patch, the average CPU usage of the client during the workload dropped to 18.8% from 56.7% before the patch. -- This message was sent by Atlassian JIRA (v6.3.4#6332)