title: Query Cassandra with Both Primary Key and Secondary Key Constraints
body: <p>I have a table in Cassandra defined as</p>
  
  <pre><code>CREATE TABLE foo ("A" text, "B" text, "C" text,
      "D" text, "E" text, "F" text,
      PRMIARY KEY ("A", "B"),
      INDEX ("C"))
  </code></pre>
  
  <p>I inserted billions of records into this table. And now I want to query the table with CQL</p>
  
  <pre><code>SELECT * FROM foo WHERE "A"='abc' AND "B"='def' AND "C"='ghi'
  </code></pre>
  
  <p>I keep receiving 1200 error saying that</p>
  
  <blockquote>
    <p>ReadTimeout: code=1200 [Coordinator node timed out waiting for replica
    nodes' responses] message="Operation timed out - received only 0
    responses." info={'received_responses': 0, 'required_responses': 1,
    'consistency': 'ONE'}</p>
  </blockquote>
  
  <p>After googling, I suspect the reason of this error is that the query is directed to some partitions that does not hold any data.</p>
  
  <p>My questions are</p>
  
  <ol>
  <li>Is there any constraint querying CQL with both primary key and secondary key specified?</li>
  <li>If I specified the partition key in my CQL, here "A"='abc' (correct me if wrong), why C* still tries other partition that apparently does not hold the data?</li>
  <li>Any hints to solve this timeout problem?</li>
  </ol>
  
  <p>Thank you!</p>