Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 66359 invoked from network); 26 May 2010 17:52:24 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 May 2010 17:52:24 -0000 Received: (qmail 26685 invoked by uid 500); 26 May 2010 17:52:23 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 26661 invoked by uid 500); 26 May 2010 17:52:23 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 26653 invoked by uid 99); 26 May 2010 17:52:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 May 2010 17:52:22 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.222.199] (HELO mail-pz0-f199.google.com) (209.85.222.199) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 May 2010 17:52:13 +0000 Received: by pzk37 with SMTP id 37so5180313pzk.27 for ; Wed, 26 May 2010 10:51:51 -0700 (PDT) Received: by 10.142.152.37 with SMTP id z37mr6219400wfd.84.1274896311753; Wed, 26 May 2010 10:51:51 -0700 (PDT) Received: from [192.168.1.106] ([67.188.70.149]) by mx.google.com with ESMTPS id i19sm268344rvn.11.2010.05.26.10.51.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 May 2010 10:51:51 -0700 (PDT) From: Peter Hsu Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: multipart/alternative; boundary=Apple-Mail-83-236363569 Subject: Re: Order Preserving Partitioner Date: Wed, 26 May 2010 10:51:46 -0700 In-Reply-To: To: user@cassandra.apache.org References: Message-Id: X-Mailer: Apple Mail (2.1078) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-83-236363569 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Correct me if I'm wrong here. Even though you can get your results with = Random Partitioner, it's a lot less efficient if you're going across = different machines to get your results. If you're doing a lot of range = queries, it makes sense to have things ordered sequentially so that if = you do need to go to disk, the reads will be faster, rather than lots of = random reads across your system. It's also my understanding that if you go with the OPP, you could hash = your key yourself using md5 or sha-1 to effectively get random = partitioning. So it's a bit of a pain, but not impossible to do a split = between OPP and RP for your different columnfamily/keyspaces. On May 26, 2010, at 2:32 AM, David Boxenhorn wrote: > Just in case you don't know: You can do range searches on keys even = with Random Partitioner, you just won't get the results in order. If = this is good enough for you (e.g. if you can order the results on the = client, or if you just need to get the right answer, but not the right = order), then you should use Random Partitioner.=20 >=20 > (I bring this up because it confused me until recently.)=20 >=20 > On Wed, May 26, 2010 at 5:14 AM, Steve Lihn = wrote: > I have a question on using Order Preserving Partitioner.=20 >=20 > Many rowKeys in my system will be related to dates, so it seems = natural to use Order Preserving Partitioner instead of the default = Random Partitioner. However, I have been warned that special attention = has to be applied for Order Preserving Partitioner to work properly = (basically to ensure a good key distribution and avoid "hot spot") and = reverting it back to Random may not be easy. Also not every rowKey is = related to dates, for these, using Random Partitioner is okay, but there = is only one place to set Partitioner. >=20 > (Note: The intension of this warning is actually to discredit = Cassandra and persuade me not to use it.) >=20 > It seems the choice of Partitioner is defined in the storage-conf.xml = and is a global property. My question why does it have to be a global = property? Is there a future plan to make it customizable per KeySpace = (just like you would choose hash or range partition for different = table/data in RDBMS) ? =20 >=20 > Thanks, > Steve=20 >=20 --Apple-Mail-83-236363569 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
Just in case you don't know: You can do range searches on = keys even with Random Partitioner, you just won't get the results in = order. If this is good enough for you (e.g. if you can order the results = on the client, or if you just need to get the right answer, but not the = right order), then you should use Random Partitioner.

(I bring this up because it confused me until recently.) =

On Wed, May 26, 2010 at 5:14 AM, = Steve Lihn <stevelihn@gmail.com> = wrote:
I have a = question on using Order Preserving Partitioner.

Many rowKeys in = my system will be related to dates, so it seems natural to use Order = Preserving Partitioner instead of the default Random Partitioner. = However, I have been warned that special attention has to be applied for = Order Preserving Partitioner to work properly (basically to ensure a = good key distribution and avoid "hot spot") and reverting it back to = Random may not be easy. Also not every rowKey is related to dates, for = these, using Random Partitioner is okay, but there is only one place to = set Partitioner.

(Note: The intension of this warning is actually to discredit = Cassandra and persuade me not to use it.)

It seems the choice of = Partitioner is defined in the storage-conf.xml and is a global property. = My question why does it have to be a global property? Is there a future = plan to make it customizable per KeySpace (just like you would choose = hash or range partition for different table/data in RDBMS) ? 

Thanks,
Steve


= --Apple-Mail-83-236363569--