Search code examples
cassandradatabase-partitioningsegment

How to read 200 million partition keys in cassandra table without request being timed out


I have a table with huge no of unique partition keys , say a table having Unique Id of all the citizens of a country

Now what i need is full table scan and read only keys . Do i need to read segment wise or i can read at once


Solution

  • Each request is paged with Cassandra drivers, (default page is 5000). Then you iterate over page (or use the iterator in the resulSet to fetch pages one after this other.

    For Full scan tables like you mentioned the recommended approach is to use token ranged/token aware queries with the token map see documentation