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 8C07E105E7 for ; Mon, 12 Aug 2013 17:09:56 +0000 (UTC) Received: (qmail 21507 invoked by uid 500); 12 Aug 2013 17:09:54 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 21449 invoked by uid 500); 12 Aug 2013 17:09:54 -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 21437 invoked by uid 99); 12 Aug 2013 17:09:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Aug 2013 17:09:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of maksimov@gmail.com designates 209.85.215.51 as permitted sender) Received: from [209.85.215.51] (HELO mail-la0-f51.google.com) (209.85.215.51) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Aug 2013 17:09:47 +0000 Received: by mail-la0-f51.google.com with SMTP id fp13so4909690lab.38 for ; Mon, 12 Aug 2013 10:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Hn1Ijtv6USHzb7THTEWNbO0HrYgexjwBx/Ex2xy5w4A=; b=CjufsGT/GMII3qYcVsgNEUTzCJXelZ8LwhvSzZqVY4NrbhuzS20kkNpDooKEvSfW5z Lh3Ke6adCwcsgRHeLYVdVzG/M1S7RGh01yETbc8BDMWNqgWx9ljrpMKxWJ5QDGgTQiEw ysYGFSXmw839kYd+bykItpXa/Hl+M6w//qRI2UOPw/Swh3r0AXUNnJCPtelvhEie7TRV qTsj03DU7cXMaEdOGKfYpmUOpzdYRy133+Ev2ev9P5HHZgvY+Q1rAZX65Eym0tvvLvtj 9lBOj3kgG3m6jizMnbh4MIPbVXPxsh2sqXTaTDiAihDTFTwvcS9CSc0IyQzujv/vDJes lEuA== MIME-Version: 1.0 X-Received: by 10.112.132.193 with SMTP id ow1mr32530lbb.40.1376327366311; Mon, 12 Aug 2013 10:09:26 -0700 (PDT) Received: by 10.114.61.240 with HTTP; Mon, 12 Aug 2013 10:09:26 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Aug 2013 18:09:26 +0100 Message-ID: Subject: Re: Performance Are Affected? - Table and Family From: Stas Maksimov To: bing.li@asu.edu Cc: user Content-Type: multipart/alternative; boundary=047d7b343f12c385af04e3c32fd3 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b343f12c385af04e3c32fd3 Content-Type: text/plain; charset=ISO-8859-1 Hi Bing, Generally it is not advised to have more than 2-3 column families, unless you are using them absolutely separately from each other. Please see here: http://hbase.apache.org/book/number.of.cfs.html Thanks, Stas On 12 August 2013 18:00, Bing Li wrote: > Dear all, > > I have one additional question about table and family. > > A table which has less families is faster than the one which has more > families if the amount of data they have is the same? Correct or not? > > Is it a higher performance design to put fewer families into a table? > > Thanks so much! > > Best regards, > Bing > > > On Tue, Aug 13, 2013 at 12:31 AM, Stas Maksimov > wrote: > > Hi there, > > > > On your second point, I don't think column family can ever be an optional > > parameter, so I'm not sure this understanding is correct. > > > > Regards, > > Stas. > > > > > > On 12 August 2013 17:22, Bing Li wrote: > >> > >> Hi, all, > >> > >> My understandings about HBase table and its family are as follows. > >> > >> 1) Each table can consist of multiple families; > >> > >> 2) When retrieving with SingleColumnValueFilter, if the family is > >> specified, other families contained in the same table are not > >> affected. > >> > >> Are these claims right? But I got a problem which conflicts with the > >> above understandings. > >> > >> In the following code, even though no any data in the family of > >> ContrivedNeighborStructure.NODE_NEIGHBOR_IN_GROUP_BASICS_FAMILY, the > >> for-loop runs many times if other families has the column of > >> ContrivedNeighborStructure.NODE_NEIGHBOR_IN_GROUP_DC_KEY_COLUMN. > >> > >> Is that normal in HBase? If so, I think it is not a good design. No > >> column overlaps must exist among the families of the same table? > >> Otherwise, retrieving the table must cause waste of scanning loops? > >> > >> Thanks so much! > >> > >> Best wishes, > >> Bing > >> > >> SingleColumnValueFilter dcKeyFilter = new > >> > >> > SingleColumnValueFilter(ContrivedNeighborStructure.NODE_NEIGHBOR_IN_GROUP_BASICS_FAMILY, > >> ContrivedNeighborStructure.NODE_NEIGHBOR_IN_GROUP_DC_KEY_COLUMN, > >> CompareFilter.CompareOp.EQUAL, new SubstringComparator(dcKey)); > >> Scan scan = new Scan(); > >> scan.setFilter(dcKeyFilter); > >> scan.setCaching(Parameters.CACHING_SIZE); > >> scan.setBatch(Parameters.BATCHING_SIZE); > >> > >> String qualifier; > >> String hostNodeKey = SocialRole.NO_NODE_KEY; > >> String groupKey = SocialGroup.NO_GROUP_KEY; > >> int timingScale = TimingScale.NO_TIMING_SCALE; > >> String key; > >> try > >> { > >> ResultScanner scanner = this.neighborTable.getScanner(scan); > >> for (Result result : scanner) > >> { > >> for (KeyValue kv : result.raw()) > >> { > >> qualifier = Bytes.toString(kv.getQualifier()); > >> if > >> > >> > (qualifier.equals(ContrivedNeighborStructure.NODE_NEIGHBOR_IN_GROUP_HOST_NODE_KEY_STRING_COLUMN)) > >> { > >> hostNodeKey = Bytes.toString(kv.getValue()); > >> } > >> else if > >> > >> > (qualifier.equals(ContrivedNeighborStructure.NODE_NEIGHBOR_IN_GROUP_HOST_GROUP_KEY_STRING_COLUMN)) > >> { > >> groupKey = Bytes.toString(kv.getValue()); > >> } > >> else if > >> > >> > (qualifier.equals(ContrivedNeighborStructure.NODE_NEIGHBOR_IN_GROUP_TIMING_SCALE_STRING_COLUMN)) > >> { > >> timingScale = Bytes.toInt(kv.getValue()); > >> } > >> } > >> if (!hostNodeKey.equals(SocialRole.NO_NODE_KEY) && > >> !groupKey.equals(SocialGroup.NO_GROUP_KEY) && timingScale != > >> TimingScale.NO_TIMING_SCALE) > >> { > >> key = Tools.GetKeyOfNode(hostNodeKey, groupKey, > >> timingScale); > >> if (!neighborMap.containsKey(key)) > >> { > >> neighborMap.put(key, new > >> NodeNeighborInGroup(hostNodeKey, groupKey, timingScale)); > >> } > >> } > >> hostNodeKey = SocialRole.NO_NODE_KEY; > >> groupKey = SocialGroup.NO_GROUP_KEY; > >> timingScale = TimingScale.NO_TIMING_SCALE; > >> } > >> } > >> catch (IOException e) > >> { > >> e.printStackTrace(); > >> } > > > > > --047d7b343f12c385af04e3c32fd3--