Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 445C8183D0 for ; Wed, 20 May 2015 03:16:10 +0000 (UTC) Received: (qmail 88254 invoked by uid 500); 20 May 2015 03:16:08 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 88173 invoked by uid 500); 20 May 2015 03:16:08 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 88160 invoked by uid 99); 20 May 2015 03:16:07 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 May 2015 03:16:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 693691A305D for ; Wed, 20 May 2015 03:16:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id z4whpL2uOX5w for ; Wed, 20 May 2015 03:15:59 +0000 (UTC) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id F23D624965 for ; Wed, 20 May 2015 03:15:58 +0000 (UTC) Received: by wicmx19 with SMTP id mx19so139098237wic.0 for ; Tue, 19 May 2015 20:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Uub/RayoU+YFzSJuubzLhmHzY0wjv6ZOxIE2/uDCrpA=; b=RewuKaPNdFSHLE9Vljxba9+/uqiowRzA8jfZPl2Jj1bDyOqr0jeVDNsAIlSZJQYYv2 Vs2+H0R4MCXN40nE3e2sAM7DB6pfkNT/2pX0/ZhYlFlXMRmhkXb3pHq9fmWtUwmZ8icc tG5iOwArkBiO1sj27Ln2it6QbEH1BwPBY1ht71NEi3aKjWLgXpSRIQo3G+X6N4wM9pr2 Se/qcwgfujoxRXM7i5VwyH09ivQMObclHFO0F/OCrypAIg63GGJOAbMB+8Slu/ruqA9B mAX1XCQjUfTWNAWkRc+RxhcISfADm9v2SQ6mMyT1nzs8j/I47Xg6WE8yNXt3CSwkZDJA mFDA== X-Received: by 10.194.216.196 with SMTP id os4mr61239295wjc.117.1432091707656; Tue, 19 May 2015 20:15:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.136.242 with HTTP; Tue, 19 May 2015 20:14:47 -0700 (PDT) In-Reply-To: References: From: Matteo Bertozzi Date: Tue, 19 May 2015 20:14:47 -0700 Message-ID: Subject: Re: Scan vs Get To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=001a11c2902a854ebd05167ad5f7 --001a11c2902a854ebd05167ad5f7 Content-Type: text/plain; charset=UTF-8 Take a look at table.rb _scan_internal() LIMIT is not passed to the server, so you fetch more rows https://github.com/apache/hbase/blob/master/hbase-shell/src/main/ruby/hbase/table.rb#L495 Matteo On Tue, May 19, 2015 at 8:11 PM, Jean-Marc Spaggiari < jean-marc@spaggiari.org> wrote: > I tried to run scan/get/scan/get many times, and always the same pattern. > You can remove the "LIMIT => 1" parameter and you will get the same > performances. > > Scan and get without the QC returns in very similar time. 191ms for one, > 194ms for the other one. > > 2015-05-19 23:02 GMT-04:00 Ted Yu : > > > J-M: > > How many times did you try the pair of queries ? > > > > Since scan was run first, this would give the get query some advantage, > > right ? > > > > Cheers > > > > On Tue, May 19, 2015 at 7:34 PM, Jean-Marc Spaggiari < > > jean-marc@spaggiari.org> wrote: > > > > > Are not Scan and Gets supposed to be almost as fast? > > > > > > I have a pretty small table with 65K lines, few columns (hundred?) > trying > > > to go a get and a scan. > > > > > > hbase(main):009:0> scan 'sensors', { COLUMNS => > > > ['v:f92acb5b-079a-42bc-913a-657f270a3dc1'], STARTROW => '000a', LIMIT > => > > 1 > > > } > > > ROW > > > COLUMN+CELL > > > > > > 000a > > > column=v:f92acb5b-079a-42bc-913a-657f270a3dc1, timestamp=1432088038576, > > > > > > value=\x08000aHf92acb5b-079a-42bc-913a-657f270a3dc1\x0EFAILURE\x0CNE-858\x > > > > > > > > > > > > 140-0000-000\x02\x96\x01SXOAXTPSIUFPPNUCIEVQGCIZHCEJBKGWINHKIHFRHWHNATAHAHQBFRAYLOAMQEGKLNZIFM > > > 000a > > > 1 row(s) in 12.6720 seconds > > > > > > hbase(main):010:0> get 'sensors', '000a', {COLUMN => > > > 'v:f92acb5b-079a-42bc-913a-657f270a3dc1'} > > > COLUMN > > > CELL > > > > > > v:f92acb5b-079a-42bc-913a-657f270a3dc1 > > timestamp=1432088038576, > > > > > > > > > value=\x08000aHf92acb5b-079a-42bc-913a-657f270a3dc1\x0EFAILURE\x0CNE-858\x140-0000-000\x02\x96\x01SXOAXTPSIUFPPNUCIEVQGCI > > > > > > ZHCEJBKGWINHKIHFRHWHNATAHAHQBFRAYLOAMQEGKLNZIFM > > > 000a > > > > > > 1 row(s) in 0.0280 seconds > > > > > > > > > They both return the same result. However, the get returns in 28ms > while > > > the scan returns in 12672ms. > > > > > > How come can the scan be that slow? Is it normal? If I remove the QC > from > > > the scan, then it takes only 250ms to return all the columns. I think > > > something is not correct. > > > > > > I'm running on 1.0.0-cdh5.4.0 so I guess it's the same for 1.0.x... > > > > > > JM > > > > > > --001a11c2902a854ebd05167ad5f7--