Using Apache Cassandra 3.11.2, defined a table like this:


create table my_table(

                   partition text,
                   clustering1 int,
                  clustering2 text,

                  data set<text>,

                primary key (partition, clustering1, clustering2))



and configured slow queries threshold to 1ms in yaml to see how queries passed 
to cassandra. Query below:



select * from my_table where partition='a' and clustering1= 1 and 
clustering2='b'



would be like this in debug.log of cassandra:



select * from my_table where partition='a' LIMIT 100>  (it means that the two 
cluster key restriction did not push down to storage engine and the whole 
partition been retrieved)



but this query:



select * from my_table where partition='a' and clustering1= 1



would be 



select * from my_table where partition='a' and clustering1= 1 LIMIT 100> 
(single cluster key been pushed down to storage engine)





So it seems to me that, we could not restrict multiple clustering keys in 
select because it would retrieve the whole partition ?!

Sent using https://www.zoho.com/mail/

Reply via email to