0

We are migrating from oracle to cassandra. We have a requirement to do minimal changes to the application.

Three questions came up when i am doing POC on cassandra.

  1. In a Oracle we have created multiple composite indexes but i don't find any document saying cassandra will support that. Is it possible to create multiple composite indexes?. If not any suggestion on this.

  2. Our Txn table is having 7 out of 15 columns used in where clause. Without index i cannot put that column in where clause. Even if i create multiple secondary index, In where clause, Casandra will select one column with low cardinality and it will not use other secondary indexes i have created. Any other way to improve the performance?

  3. Problem on creating index on boolean data type. This is how we are decided to create a table/columnfamily

create table dept( emp_name varchar, emp_id int, dept_id int, dept_name varchar, active boolean, primary key(dept_id,emp_id));

In application we have queries like below 1. select * from dept where dept_name='software'; I have created secondary index for dept_name. So This problem is solved.

  1. select * from dept where dept_id=1001 and active = 'Y'; I feel difficult to create indexes for this query. Since active column is a boolean type, creating secondary index is not useful. Without index i will not able to include that condition in where clause.

Any suggestions for my queries?

suresh
  • 341
  • 2
  • 3
  • 13
  • 3
    I think ramming a complex RDBMS schema onto Cassandra with "minimal changes to the application" is extremely ill-advised. Cassandra's performance can be realized only if you are able to design a schema that will take advantage of the architecture. Even in that case, you will have to significantly rework your client code. – Daniel S. Jan 27 '14 at 03:15
  • for #1) The standard suggestion for this use case is that you have to create several tables for some, or all, of the indices that you require in your app. This, obviously, means denormalizing your schema and storing multiple copies of the same data. – Daniel S. Jan 27 '14 at 03:17
  • #2) As per #1, you'll need to create multiple tables, and put all, or most of your WHERE columns into their primary keys. You'll get great performance, but the downside is significant denormalization. – Daniel S. Jan 27 '14 at 03:19

0 Answers0