title: Cassandra using composite indexes and secondary together
body: <p>We want to use cassandra to store complex data<br>
  but we can't figure out how to organize indexes.</p>
  
  <p>Our table (column family) looks like this:</p>
  
  <pre><code>Users =
    { 
      RandomId int,
      Firstname varchar,
      Lastname varchar,
      Age int,
      Country int,
      ChildCount int
    }
  </code></pre>
  
  <p>We have queries with mandatory fields (Firstname, Lastname, Age) and extra search options (Country, ChildCount).<br>
  How should we organize the index to make this kind of queries faster?</p>
  
  <p>First I thought, it would be natural to make composite index on (Firstname, Lastname, Age) and add separate secondary index on remaining fields (Country and ChildCount).<br>
  But I can't insert rows into table after creating secondary indexes and I can't query the table. </p>
  
  <p>Using  </p>
  
  <ul>
  <li>cassandra 1.1.0</li>
  <li>cqlsh with --cql3 option.</li>
  </ul>
  
  <p>Any other suggestions to solve our problem (complex queries with mandatory and additional options) are welcome.</p>