Search code examples
cassandracqlcql3

Selecting everything from a cassandra table


Currently I am using the following query as described here to page through the table:

 select token(id) as token_id, description, title from my_table where token(id) >= -8987733732583272758 limit 10;

The next page would the be queried with the last token of the previous query:

 select token(id) as token_id, description, title from my_table where token(id) >= -7325522621472161647 limit 10;

Now my question is: Is this correct? Is the result-set always ordered by the token(id), so that I do not skip any rows?


Solution

  • I think since Cassandra 2.0 there is automatic paging available if you use the java driver. So the token approach may not be the best way to page through a table.

    See more information here: automatic paging.