Re: Cannot get secondary indexes on fields in compound primary key to work (Cassandra 2.0.0)
For the record: https://issues.apache.org/jira/browse/CASSANDRA-5975 (2.0.1) resolved this issue for me. 2013/9/8 Petter von Dolwitz (Hem) > Thank you for you reply. > > I will look into this. I cannot not get my head around why the scenario I > am describing does not work though. Should I report an issue around this or > is this expected behaviour? A similar setup is described on this blog post > by the development lead. > > http://www.datastax.com/dev/blog/cql3-for-cassandra-experts > > > > > 2013/9/6 Robert Coli > >> On Fri, Sep 6, 2013 at 6:18 AM, Petter von Dolwitz (Hem) < >> petter.von.dolw...@gmail.com> wrote: >> >>> I am struggling with getting secondary indexes to work. I have created >>> secondary indexes on some fields that are part of the compound primary key >>> but only one of the indexes seems to work (the one set on the field 'e' on >>> the table definition below). Using any other secondary index in a where >>> clause causes the message "Request did not complete within rpc_timeout.". >>> It seems like if a put a value in the where clause that does not exist in a >>> column with secondary index then cassandra quickly return with the result >>> (0 rows) but if a put in a value that do exist I get a timeout. There is no >>> exception in the logs in connection with this. I've tried to increase the >>> timeout to a minute but it does not help. >>> >> >> In general unless you absolutely need the atomicity of the update of a >> secondary index with the underlying storage row, you are better off making >> a manual secondary index column family. >> >> =Rob >> > >
Re: Cannot get secondary indexes on fields in compound primary key to work (Cassandra 2.0.0)
Thank you for you reply. I will look into this. I cannot not get my head around why the scenario I am describing does not work though. Should I report an issue around this or is this expected behaviour? A similar setup is described on this blog post by the development lead. http://www.datastax.com/dev/blog/cql3-for-cassandra-experts 2013/9/6 Robert Coli > On Fri, Sep 6, 2013 at 6:18 AM, Petter von Dolwitz (Hem) < > petter.von.dolw...@gmail.com> wrote: > >> I am struggling with getting secondary indexes to work. I have created >> secondary indexes on some fields that are part of the compound primary key >> but only one of the indexes seems to work (the one set on the field 'e' on >> the table definition below). Using any other secondary index in a where >> clause causes the message "Request did not complete within rpc_timeout.". >> It seems like if a put a value in the where clause that does not exist in a >> column with secondary index then cassandra quickly return with the result >> (0 rows) but if a put in a value that do exist I get a timeout. There is no >> exception in the logs in connection with this. I've tried to increase the >> timeout to a minute but it does not help. >> > > In general unless you absolutely need the atomicity of the update of a > secondary index with the underlying storage row, you are better off making > a manual secondary index column family. > > =Rob >
Re: Cannot get secondary indexes on fields in compound primary key to work (Cassandra 2.0.0)
On Fri, Sep 6, 2013 at 6:18 AM, Petter von Dolwitz (Hem) < petter.von.dolw...@gmail.com> wrote: > I am struggling with getting secondary indexes to work. I have created > secondary indexes on some fields that are part of the compound primary key > but only one of the indexes seems to work (the one set on the field 'e' on > the table definition below). Using any other secondary index in a where > clause causes the message "Request did not complete within rpc_timeout.". > It seems like if a put a value in the where clause that does not exist in a > column with secondary index then cassandra quickly return with the result > (0 rows) but if a put in a value that do exist I get a timeout. There is no > exception in the logs in connection with this. I've tried to increase the > timeout to a minute but it does not help. > In general unless you absolutely need the atomicity of the update of a secondary index with the underlying storage row, you are better off making a manual secondary index column family. =Rob
Cannot get secondary indexes on fields in compound primary key to work (Cassandra 2.0.0)
I am struggling with getting secondary indexes to work. I have created secondary indexes on some fields that are part of the compound primary key but only one of the indexes seems to work (the one set on the field 'e' on the table definition below). Using any other secondary index in a where clause causes the message "Request did not complete within rpc_timeout.". It seems like if a put a value in the where clause that does not exist in a column with secondary index then cassandra quickly return with the result (0 rows) but if a put in a value that do exist I get a timeout. There is no exception in the logs in connection with this. I've tried to increase the timeout to a minute but it does not help. I am currently running on a single machine with 12 GB RAM and the heap set to 8 GB. The table and indexes occupy 1 GB of disk space. I query the table with cqlsh. The below issue should have fixed something in this area. Is this still a problem or is it something in my environmnet/design that is the problem? https://issues.apache.org/jira/browse/CASSANDRA-5851 /Petter TABLE DEFINITION- CREATE TABLE x.y ( a varchar, b varchar, c varchar, d varchar, e varchar, f varchar, g varchar, h varchar, i int, j varchar, k varchar, l timestamp, m blob, PRIMARY KEY (a, b, c, d, e, f, g, h, i, j, k, l) ); CREATE INDEX d_idx ON x.y ( d ); CREATE INDEX e_idx ON x.y ( e ); CREATE INDEX f_idx ON x.y ( f ); CREATE INDEX g_idx ON x.y ( g ); CREATE INDEX h_idx ON x.y ( h ); CREATE INDEX i_idx ON x.y ( i ); CREATE INDEX j_idx ON x.y ( j ); CREATE INDEX k_idx ON x.y ( k );