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 77EFBD30F for ; Sun, 4 Nov 2012 18:50:19 +0000 (UTC) Received: (qmail 78772 invoked by uid 500); 4 Nov 2012 18:50:17 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 78702 invoked by uid 500); 4 Nov 2012 18:50:16 -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 78694 invoked by uid 99); 4 Nov 2012 18:50:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Nov 2012 18:50:16 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of edlinuxguru@gmail.com designates 209.85.223.172 as permitted sender) Received: from [209.85.223.172] (HELO mail-ie0-f172.google.com) (209.85.223.172) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Nov 2012 18:50:09 +0000 Received: by mail-ie0-f172.google.com with SMTP id 9so7943003iec.31 for ; Sun, 04 Nov 2012 10:49:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=JrIwrHZ2STHF5d5LMrua5twxIKvdUdNxgfR6fJsfVEM=; b=1B0tv3j4wa/SN+K/U77zEH0HXbbd9BAF99KWQlTucJIAw/GuzY4/cH65OcQGqbBXlx spvmAlMLK2+p50EphZXLDUldra6uvvADmqGiuByj3WneMFV9vA4S5OptXkkFEc/6Nluq /H4OTtfBBJVF2sRroKfZ5bTGuqQsMO5yCbsJlytOkmpNSpCVCjYV475zoAAGOMOc/I8C h+YViYWE8vRbKQ/q3/UPnQ8/6IHIYfNa2sW7SFU0t3pnMr40p4DJSh/vVswLgZnLbntE XRIw57W5Ard/+CUVZSDdgj3yXooxN7Ieo2VNxR4AxUZlE55e8MNiFrtS1liKPREdQRie C8Dw== MIME-Version: 1.0 Received: by 10.50.178.106 with SMTP id cx10mr7659654igc.24.1352054989178; Sun, 04 Nov 2012 10:49:49 -0800 (PST) Received: by 10.64.97.106 with HTTP; Sun, 4 Nov 2012 10:49:48 -0800 (PST) Date: Sun, 4 Nov 2012 13:49:48 -0500 Message-ID: Subject: How does Cassandra optimize this query? From: Edward Capriolo To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org If we create a column family: CREATE TABLE videos ( videoid uuid, videoname varchar, username varchar, description varchar, tags varchar, upload_date timestamp, PRIMARY KEY (videoid,videoname) ); The CLI views this column like so: create column family videos with column_type = 'Standard' and comparator = 'CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type)' and default_validation_class = 'UTF8Type' and key_validation_class = 'UUIDType' and read_repair_chance = 0.1 and dclocal_read_repair_chance = 0.0 and gc_grace = 864000 and min_compaction_threshold = 4 and max_compaction_threshold = 32 and replicate_on_write = true and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' and caching = 'KEYS_ONLY' and compression_options = {'sstable_compression' : 'org.apache.cassandra.io.compress.SnappyCompressor'}; [default@videos] list videos; Using default limit of 100 Using default column limit of 100 ------------------- RowKey: b3a76c6b-7c7f-4af6-964f-803a9283c401 => (column=Now my dog plays piano!:description, value=My dog learned to play the piano b ecause of the cat., timestamp=1352058289070000) => (column=Now my dog plays piano!:tags, value=dogs,piano,lol, timestamp=1352058289070001) invalid UTF8 bytes 00000139794c30c0 SELECT * FROM videos WHERE videoname = 'My funny cat'; videoid | videoname | description | tags | u pload_date | username --------------------------------------+--------------+-------------------------------------------+----------------+-- ------------------------+---------- 99051fe9-6a9c-46c2-b949-38ef78858dd0 | My funny cat | My cat likes to play the piano! So funny. | cats,piano,lol | 2 012-06-01 08:00:00+0000 | ctodd CQL3 Allows me to search the second component of a primary key. Which really just seems to be component 1 of a composite column. So what thrift operation does this correspond to? This looks like a column slice without specifying a key? How does this work internally?