cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Hardouin <romainh...@yahoo.fr>
Subject Re: secondary index on static column
Date Thu, 02 Feb 2017 14:06:06 GMT
Hi,
What's your C* 3.X version?I've just tested it on 3.9 and it works:
cqlsh> SELECT * FROM test.idx_static where id2=22;
 id  | added                           | id2 | source | dest-----+---------------------------------+-----+--------+------ id1
| 2017-01-27 23:00:00.000000+0000 |  22 |   src1 | dst1
(1 rows)
Maybe your dataset is incorrect (try on a new table) or you hit a bug.
Best,
Romain
 

    Le Vendredi 27 janvier 2017 9h44, Micha <micha-1@fantasymail.de> a écrit :
 

 Hi,

I'm quite new to cassandra and allthough there is much info on the net,
sometimes I cannot find the solution to a problem.

In this case, I have a second index on a static column and I don't
understand the answer I get from my select.

A cut down version of the table is:

create table demo (id text, id2 bigint static, added timestamp, source
text static, dest text, primary key (id, added));

create index on demo (id2);

id and id2 match one to one.

I make one insert:
insert into demo (id, id2, added, source, dest) values ('id1', 22,
'2017-01-28', 'src1', 'dst1');


The "select from demo;" gives the expected answer of the one inserted row.

But "select from demo where id2=22" gives 70 rows as result (all the same).

Why? I have read
https://www.datastax.com/dev/blog/cassandra-native-secondary-index-deep-dive

but I don't get it...

thanks for answering,
 Michael



   
Mime
View raw message