I am using Cassandra 1.1.2. I am trying to convert an RDBMS application to Cassandra. In my RDBMS application, I have the following table called table1:
| Col1 | Col2 | Col3 | Col4 |
- Col1: String (primary key)
- Col2: String (primary key)
- Col3: Bigint (index)
- Col4: Bigint
This table has over 200 million records. The most commonly used query looks something like this:
Select * from table where col3 < 100 and col3 > 50;
In Cassandra, I used the following statement to create a table:
create table table1 (primary_key varchar, col1 varchar, col2 varchar, col3 bigint, col4 bigint, primary key (primary_key)); create index on table1(col3);
I changed the primary key to an extra column (I am calculating the key inside my application). After importing several records, I tried to execute the following cql:
select * from table1 where col3 < 100 and col3 > 50;
This result:
Bad Request: No indexed columns present in by-columns clause with Equal operator
The query select col1, col2, col3, col4 from table 1, where col3 = 67 works
Google said it was not possible to fulfill such requests. It is right? Any advice on how to create such a query?
source share