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 46FFFDF26 for ; Tue, 9 Oct 2012 07:30:42 +0000 (UTC) Received: (qmail 11003 invoked by uid 500); 9 Oct 2012 07:30:40 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 10923 invoked by uid 500); 9 Oct 2012 07:30:40 -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 10912 invoked by uid 99); 9 Oct 2012 07:30:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2012 07:30:39 +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 (nike.apache.org: domain of sylvain@datastax.com designates 209.85.220.44 as permitted sender) Received: from [209.85.220.44] (HELO mail-pa0-f44.google.com) (209.85.220.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2012 07:30:32 +0000 Received: by mail-pa0-f44.google.com with SMTP id fb11so4859958pad.31 for ; Tue, 09 Oct 2012 00:30:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=UJQhU9uIV3+KQ/NCIIOG8SycvWCaDrQJheRVlACVLgo=; b=QZPjIP3Z9+JtR3HWtmFIWxN+ZrQhIYnF1PiTS2gV5mBW1DLxugoUvhEt3eRyvZuLxS LYc7c4d9XzhW89wXn7K9J7tciJ88mUQdq3Z0V5oeF/MgyoLel4b6FVh4QBGyArVDWdlP p2oyJb4Vcv+6wJ5Q4UMJ6WxgIYMu+tQVn4GuCGmS641VXgso87itK4k9V7ptS0DzaPL3 a/vwN/6gbMltLi+cvZ9gtDOy3h2COlYaDS/t9WDvI+DlO0DFbfZStE8yvx0i/FIdd+k7 TKuQy7Ar2lKzvSHJNUYv78T5H18Zz/GCvpSPeSAA6fDz/xRUe1VGsL7ir+rP09JZiD+j UHaQ== MIME-Version: 1.0 Received: by 10.68.197.197 with SMTP id iw5mr39920568pbc.22.1349767810685; Tue, 09 Oct 2012 00:30:10 -0700 (PDT) Received: by 10.68.64.70 with HTTP; Tue, 9 Oct 2012 00:30:10 -0700 (PDT) In-Reply-To: References: Date: Tue, 9 Oct 2012 09:30:10 +0200 Message-ID: Subject: Re: question about where clause of CQL update statement From: Sylvain Lebresne To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkt12WU0FcOx3YEjoyqkzr1B25peY9ih++9iojginLfbQlj8uYrILWkZIwrr+RQHhb8Z1pS > Is it not possible to include a column in both the set clause and in the where clause? No it's not. Or rather in that case what is not supported is the use of secondary indexes in update where clauses. But if 'locked' is indeed not part of your primary key, then at least the error message suck and will need to be improved. Now, why isn't this supported? Honestly I don't remember that we have discussed this much, but I see at least 2 potential reasons why we might hesitate doing it: 1) we won't really be able to implement this in a much better way that you would do client (i.e. by first querying the secondary index and then doing the insertion). In particular, we won't be able to guarantee the atomicity of the read/write involved by such operation. 2) currently writes don't involve read (that isn't true for 2ndary index updates currently but that will be fixed in Cassandra 1.2). That would be a case where a write involves a read, and a fairly costly one. This is not saying this is a bad idea, just that there is more to it than "we've been too lazy to implement it". But if you are interested I encourage you to open a ticket on JIRA to start a discussion. -- Sylvain