Reputation: 298
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
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