user3024119
user3024119

Reputation: 298

Cassandra : How query with secondary index and clustering keys range work

Ex:

In Table A, id is partion key and time is clustering key and deviceid is secondary index

Query 1) Select * from A where id=1234 and time > xx and time < vv and deviceid='dddd'; How this query works? I have enable tracing .

It is first filtering secondary index and then filtering range.I was expecting the reverse.

Does the above work impact performance?

Upvotes: 0

Views: 217

Answers (1)

undefined_variable
undefined_variable

Reputation: 6228

No.

Cassandra will use the same plan for both the queries.

You can use TRACING ON command in cql to look at the plan that cassandra uses to fetch the records.

They will be same in both the cases.

Because partition key is used only single node will be referred in both the cases.

Upvotes: 1

Related Questions