title: Range Queries in Cassandra (CQL 3.0)
body: <p>One main part of Cassandra that I don't fully understand is its range queries.  I know that Cassandra emphasizes distributed environment and focuses on performance, but probably because of that, it currently only support several types of ranges queries that it can finish efficiently, and what I would like to know is that: which types of range queries are supported by Cassandra.</p>
  
  <p>As far as I know, Cassandra supports the following range queries:</p>
  
  <p>1: Range Queries on Primary key with keyword <code>TOKEN</code>, for example:</p>
  
  <pre><code> CREATE TABLE only_int (int_key int PRIMARY KEY);
   ...
   select * from only_int where token(int_key) &gt; 500;
  </code></pre>
  
  <p>2: Range Queries with one equality condition on a secondary index with keyword <code>ALLOW FILTERING</code>, for example:</p>
  
  <pre><code>CREATE TABLE example (
    int_key int PRIMARY KEY,
    int_non_key int,
    str_2nd_idx ascii
  );
  CREATE INDEX so_example_str_2nd_idx ON example (str_2nd_idx);
  ...
  select * from example where str_2nd_idx = 'hello' and int_non_key &lt; 5 allow filtering;
  </code></pre>
  
  <p>But I am wondering if I miss something and looking for a canonical answer which lists all types of range queries supported by the current CQL (or some work-around that allows more types of range queries).</p>