Hi,

This question is just for curiosity purposes, I don't need this in my
solution, but it's something I was asking myself...

Is there a way of indexing the partition key values in Cassandra? Does
anyone needed this and found a solution of any kind?

For example, I know the sample bellow doesn't work, but would it be
possible somehow?
I know select * from testcf where token(key1) > token('Lucas'); works, but
the question is ordering by the values, even using another CF or index of
any kind...

CREATE KEYSPACE IF NOT EXISTS testks
  WITH REPLICATION = { 'class' : 'SimpleStrategy',
  'replication_factor': '1' };


CREATE TABLE IF NOT EXISTS testcf (
  key1 varchar,
  value varchar,
  PRIMARY KEY ((key1)));

CREATE INDEX testidx on testks.testcf (key1);

insert into testcf (key1, value) values ('Lucas', 'value1');
insert into testcf (key1, value) values ('Luiz', 'value2');
insert into testcf (key1, value) values ('Edu', 'value3');
insert into testcf (key1, value) values ('Marcelo', 'value4');

select * from testcf order by key1;
select * from testcf where key1 > 'Lucas';


Best regards,
Marcelo.

Reply via email to