Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Cassandra CQL queries explain plan

How can I get an execution plan (or smth like that) for a CQL query? I failed to find any consolidated document about CQL query optimization/execution.

For instance I want to find out, is there any difference in execution of queries like:

select some_column from SOME_TABLE where 
pkField='val1' 
and timestampField='date' 
allow filtering;

and

select some_column from SOME_TABLE where 
pkField='val1' 
and timestampField<='date' 
and timestampField>='date' 
allow filtering;
like image 784
nukie Avatar asked Feb 24 '15 13:02

nukie


1 Answers

Cassandra does not use sophisticated query optimizers as most traditional RDBMS do. Index usage is much more deterministic due to missing relationships between tables.

When it comes to execution, rows are distributed accross individual nodes and possibly multiple sstables within nodes. The actual read path will be different over time for the same query.

To get more details about query execution use TRACING ON; in your cqlsh.

like image 169
Stefan Podkowinski Avatar answered Sep 17 '22 23:09

Stefan Podkowinski