No, Cassandra uses statistics to see which index will result in less rows to check.
On Wed, May 11, 2011 at 12:42 PM, Baskar Duraikannu <baskar.duraikannu...@gmail.com> wrote: > Hello - > I am using 0.8 Beta 2 and have a CF containing COMPANY, ACCOUNTNUMBER and > some account related data. I have index on both Company and AccountNumber. > If I run a query - > > SELECT <DATA> FROM COMPANYCF WHERE COMPANY='XXX' AND ACCOUNTNUMBER = 'YYY' > > Even though ACCOUNTNUMBER based Index is a better index to use for the above > query compared to COMPANY based Index, Cassandra seems to pick COMPANY > index. > Does Cassandra always uses Index on first "where" clause? > I can always change the above query to have account number as the first > "where" clause. > Just wanted to understand whether any kind of index optimization built into > Cassandra 0.8. > Thanks > Baskar Duraikannu > > > -- Jonathan Ellis Project Chair, Apache Cassandra co-founder of DataStax, the source for professional Cassandra support http://www.datastax.com