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 BD04C9C6C for ; Tue, 26 Jun 2012 08:21:32 +0000 (UTC) Received: (qmail 83414 invoked by uid 500); 26 Jun 2012 08:21:30 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 83171 invoked by uid 500); 26 Jun 2012 08:21:30 -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 83142 invoked by uid 99); 26 Jun 2012 08:21:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2012 08:21:29 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,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.214.172 as permitted sender) Received: from [209.85.214.172] (HELO mail-ob0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2012 08:21:22 +0000 Received: by obbwc20 with SMTP id wc20so8870622obb.31 for ; Tue, 26 Jun 2012 01:21:01 -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:content-transfer-encoding:x-gm-message-state; bh=fghfjDa9aPmw5YwDMHM+bcjL8xGDuN70HebNwwdK/gQ=; b=D4fjMarUhQajvXYXCNYkITiq32MHXDNuJ3KTXohN1r2AHFzRWyGv592wni/GXIbbeu +Zg94DSFbaqIYeoGG/wp3teSYCarGlBD84cb7CI9/iC9+q3OSZX0Jy4pU1IWb52FaqbE iT9BpXNfCmn314d3+nXDFOA46lDLnNMnoWYnauYWoPFjvZrT3hszKU1RlcjE05wBdtlh VrO8FN243dapNaKyzt3d9IPBlUxpkBmdkr2TXaN1cbBjzn+Dies96Isf67lq/OfQ0Wnt fAWa7MCiS/a9xSYCHghbXYpim9ENNCJejX28LIj5A2Df/lLC3M0Xfgs476JTzslwKK9P 8A7w== MIME-Version: 1.0 Received: by 10.60.25.100 with SMTP id b4mr15122032oeg.64.1340698861059; Tue, 26 Jun 2012 01:21:01 -0700 (PDT) Received: by 10.182.17.136 with HTTP; Tue, 26 Jun 2012 01:21:00 -0700 (PDT) In-Reply-To: References: Date: Tue, 26 Jun 2012 10:21:00 +0200 Message-ID: Subject: Re: Request Timeout with Composite Columns and CQL3 From: Sylvain Lebresne To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmTXVDfSjscSO/HhPMAhe5b9pN15aYWTTbVMM6CgXgIIU9uKENv3jsok57xr8cR2mMCX6tx On Mon, Jun 25, 2012 at 11:10 PM, Henning Kropp wrote: > Hi, > > I am running into timeout issues using composite columns in cassandra 1.1= .1 > and cql 3. > > My keyspace and table is defined as the following: > > create keyspace bn_logs > =A0=A0=A0 with strategy_options =3D [{replication_factor:1}] > =A0=A0=A0 and placement_strategy =3D 'org.apache.cassandra.locator.Simple= Strategy'; > > CREATE TABLE logs ( > =A0 id text, > =A0 ref text, > =A0 time bigint, > =A0 datum text, > =A0 PRIMARY KEY(id, ref, time) > ); > > I import some data to the table by using a combination of the thrift > interface and the hector Composite.class by using its serialization as th= e > column name: > > Column col =3D new Column(composite.serialize()); > > This all seems to work fine until I try to execute the following query wh= ich > leads to a request timeout: > > SELECT datum FROM logs WHERE id=3D'861' and ref =3D 'raaf' and time > '30= 00'; If it timeouts the likely reason is that this query selects more data than the machine is able to fetch before the timeout. You can either add a limit to the query, or increase the timeout. If that doesn't seem to fix it, it might be worth checking the server log to see if there isn't an error. > I really would like to figure out, why running this query on my laptop > (single node, for development) will not finish. I also would like to know= if > the following query would actually work > > SELECT datum FROM logs WHERE id=3D'861' and ref =3D 'raaf*' and time > '3= 000'; It won't. You can perform the following query: SELECT datum FROM logs WHERE id=3D'861' and ref =3D 'raaf'; which will select every datum whose ref starts with 'raaf', but then you cannot restrict the time parameter, so you will get ref where the time is <=3D 3000. Of course you can always filter client side if that is an option. > or how else there is a way to define a range for the second component of = the > column key? As described above, you can define a range on the second component, but the= n you won't be able to restrict on the 3rd component. > > Any thoughts? > > Thanks in advance and kind regards > Henning >