Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-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 9A4687914 for ; Sun, 24 Jul 2011 22:42:46 +0000 (UTC) Received: (qmail 66903 invoked by uid 500); 24 Jul 2011 22:42:44 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 66863 invoked by uid 500); 24 Jul 2011 22:42:43 -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 66855 invoked by uid 99); 24 Jul 2011 22:42:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Jul 2011 22:42:43 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a49.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Jul 2011 22:42:36 +0000 Received: from homiemail-a49.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a49.g.dreamhost.com (Postfix) with ESMTP id 6CB955E0059 for ; Sun, 24 Jul 2011 15:42:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=thelastpickle.com; h=content-type :mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; q=dns; s= thelastpickle.com; b=loFHmRTh4gqI/XFdmxpFgZgt5XTig6HWxMmDgQvp1eC wg/uUg/nYob5tq1mkLNGQyJzELdN7xYa7IleNc7efhwHIPZmZrnjIdPgMiA6614t 93lgO4dT/I4SIjozfbBM/vYo+QBEkz93RxYS18q+yJbfDJ1hqsLImTjnnl3zT4FU = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h= content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; s= thelastpickle.com; bh=tmSkI8JdGwg4lpG58mCL/ZycX6s=; b=y59t3XOhxD 9EI1bvT+LpKGvy+Vkdli4cHyxzyPoFae0kXgTHxywnJdgoXOYy+oIsd77PHcKYDa CWqR5Oji6AriTpgIqZ8UuOx2JciS/2G1+PVdhRaSQXDuX+xV0UQaiHr7+BWqPKZq eZYtLOWOlcMBnU1Ok3FFHP/6QHwZVBlV0= Received: from [198.48.1.52] (198-48-1-52-dhcp.cafenet.co.nz [198.48.1.52]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a49.g.dreamhost.com (Postfix) with ESMTPSA id 187805E0058 for ; Sun, 24 Jul 2011 15:42:14 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1244.3) Subject: Re: "select * from A join B using(common_id) where A.id == a and B.id == b " From: aaron morton In-Reply-To: Date: Mon, 25 Jul 2011 10:42:12 +1200 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: user@cassandra.apache.org X-Mailer: Apple Mail (2.1244.3) X-Virus-Checked: Checked by ClamAV on apache.org > my fall-back approach is, since A and B do not change a lot, I'll > pre-generate the join of A and B (not very large) keyed on A.id + > B.id, > then do the get(a+b) +1 materialise views / joins you know you want ahead of time. Trade = space for time.=20 Cheers ----------------- Aaron Morton Freelance Cassandra Developer @aaronmorton http://www.thelastpickle.com On 23 Jul 2011, at 10:41, Yang wrote: > this is a common pattern used in RDMS, > is there some existing idiom to do it in cassandra ? >=20 >=20 > if the size of "select * from A where id =3D=3D a " is very large, and > similarly for B, while the join of A.id =3D=3D a and B.id=3D=3Db is = small, > then doing a get() for both and then merging seems excessively slow. >=20 >=20 > my fall-back approach is, since A and B do not change a lot, I'll > pre-generate the join of A and B (not very large) keyed on A.id + > B.id, > then do the get(a+b) >=20 >=20 > thanks > Yang