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 2E22C200D3A for ; Wed, 15 Nov 2017 17:12:56 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2C524160BF4; Wed, 15 Nov 2017 16:12:56 +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 740AE160BEA for ; Wed, 15 Nov 2017 17:12:55 +0100 (CET) Received: (qmail 22914 invoked by uid 500); 15 Nov 2017 16:12:53 -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 22904 invoked by uid 99); 15 Nov 2017 16:12:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2017 16:12:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id DACCC1806AB for ; Wed, 15 Nov 2017 16:12:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id MX1iHPxx_rsS for ; Wed, 15 Nov 2017 16:12:52 +0000 (UTC) Received: from mail-qt0-f175.google.com (mail-qt0-f175.google.com [209.85.216.175]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id EABBB5FBEE for ; Wed, 15 Nov 2017 16:12:51 +0000 (UTC) Received: by mail-qt0-f175.google.com with SMTP id n61so35496465qte.10 for ; Wed, 15 Nov 2017 08:12:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=pMUyWCvf/RGUwfFh8DwGxB1i5t26sV5YUdVMqha3Qfw=; b=Ho3hi4lgNIY1nSFxsfh1RBBMycHSUwuWxP8sIm5zWKeCzybrspT1tqpFDj/UeqRu2h Z8Ch2ouS9Chc0QQ7/tlLMOpdbJH+Cat+1XBO4TAt/FIJSIxzpeM4DvIAHUThadW3Cthj sXM/0NFlkLWThXNXXfOwTl4T1rMVyKQzqI27PPjP5ynP/LMxyiwzi+ShURJxaZ9gZLnd A9L66MqxoJAdHesbBtK6F1YWLcVcGasGKpTRLEg03/pMaSZGC1YmlSbwSTneaoaHGZIV nio7jihI5RRiFrbDhpdsHFYrqS5uL8vPEs8sJOPkWdk1sIEqw8cud/Sb1jQuRBzMSpQi H8kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=pMUyWCvf/RGUwfFh8DwGxB1i5t26sV5YUdVMqha3Qfw=; b=OZRnfNY8xAQ8EbC5gMQNtczLuh58sEHJxo+SFAOFkceyak1WU+a9ndhBU8UBI7caN0 xAID80eOpNuo2edBG7lsuIAUHoEpmoTmXRdjnJR7w5ahgSklZ3gLrvFj8XhsUtPAzhHe /Wv9GczMqMj9cM2BzqwVfbHcOEPPRwqN0otjhE1wVq0YS6TOPgI5NQhjm1EcscM+WoKK Oph8Uu2FlNBr7gdcOwd0IbEfkICs8KFAWH2xm6LfP1wxwS3jlf0dj1s++d9/rFEPDpIu 7QL+4tMZNWDTTkx8wdQr1H+hCBuYJx99pV6IYq64xNjpr79QuCSK73jE11qpSXhV0AF9 BLMg== X-Gm-Message-State: AJaThX5h3fB7QPAHErzxxrtHJ2zl8JZSu81RcWv8FZmh/YHSnz+NYwUm yYKSMGJ7VgvB85Z19UnXE6K9QRg/SfiXQPHYLArOUQ== X-Google-Smtp-Source: AGs4zMYWv+p9F3CC3Wf3Rew5wjHYZrHd8m8FGnYWCMmvIK+6N5ChhUEp66vGTQ8ToHJoAMQdfZOTI8Yy97tKgVIPVcE= X-Received: by 10.200.47.12 with SMTP id j12mr26143421qta.204.1510762371252; Wed, 15 Nov 2017 08:12:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.54.39 with HTTP; Wed, 15 Nov 2017 08:12:50 -0800 (PST) From: eugene miretsky Date: Wed, 15 Nov 2017 11:12:50 -0500 Message-ID: Subject: CQL Map vs clustering keys To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary="001a11411d687a853c055e07c60d" archived-at: Wed, 15 Nov 2017 16:12:56 -0000 --001a11411d687a853c055e07c60d Content-Type: text/plain; charset="UTF-8" Hi, What would be the tradeoffs between using 1) Map ( id UUID PRIMARY KEY, myMap map ); 2) Clustering key ( id UUID PRIMARY KEY, key int, val text, PRIMARY KEY (id, key)) ); My understanding is that maps are stored very similarly to clustering columns, where the map key is part of the SSTable's column name. The main difference seems to be that with maps all the key/value pairs get retrieved together, while with clustering keys we can retrieve individual rows, or a range of keys. Cheers, Eugene --001a11411d687a853c055e07c60d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,=C2=A0

What would be the tradeoffs b= etween using

1) Map

(
id UUID PRIMARY KEY,=C2=A0=C2=A0
myMap map<int,text>
);
2) Clustering key

(
=C2=A0id UUID PRIMARY KEY,
key int,
val text,
=
PRIMARY KEY (id, key))
);
=

My understanding is that maps are stored very sim= ilarly to clustering columns, where the map key is part of the SSTable'= s column name. The main difference seems to be that with maps all the key/v= alue pairs get retrieved together, while with clustering keys we can retrie= ve individual rows, or a range of keys.=C2=A0

Chee= rs,
Eugene=C2=A0
--001a11411d687a853c055e07c60d--