title: Why Cassandra secondary indexes are so slow on just 350k rows?
body: <p>I have a column family with the secondary index. The secondary index is basically a binary field, but I'm using a string for it. The field called <strong>is_exported</strong> and can be <strong>'true'</strong> or <strong>'false'</strong>. After request all loaded rows are updated with <strong>is_exported = 'false'</strong>.</p>
  
  <p>I'm polling this column table each ten minutes and exporting new rows as they appear.</p>
  
  <p>But here the problem: I'm seeing that time for this query grows pretty linear with amount of data in column table, and currently it takes <strong>from 12 to 20 seconds (!!!) to find 5000 rows</strong>. From my understanding, indexed request should not depend on number of rows in CF but from number of rows per one index value (cardinality), as it's just another hidden CF like:</p>
  
  <pre><code>    "true" : rowKey1 rowKey2 rowKey3 ...
      "false": rowKey1 rowKey2 rowKey3 ...
  </code></pre>
  
  <p>I'm using Pycassa to query the data, here the code I'm using:</p>
  
  <pre><code>    column_family = pycassa.ColumnFamily(cassandra_pool, column_family_name, read_consistency_level=2)
      is_exported_expr = create_index_expression('is_exported', 'false')
      clause = create_index_clause([is_exported_expr], count = 5000)
      column_family.get_indexed_slices(clause)
  </code></pre>
  
  <p>Am I doing something wrong, but I expect this operation to work MUCH faster.</p>
  
  <p>Any ideas or suggestions?</p>
  
  <p>Some config info:</p>
  
  <ul>
  <li>Cassandra 1.1.0 </li>
  <li>RandomPartitioner</li>
  <li>I have 2 nodes and replication_factor = 2 (each server has a full data copy)</li>
  <li>Using AWS EC2, large instances</li>
  <li>Software raid0 on ephemeral drives</li>
  </ul>
  
  <p>Thanks in advance!</p>