英文:
How to read 200 million partition keys in cassandra table without request being timed out
问题
我有一张包含大量唯一分区键的表,比如一张包含某国所有公民的唯一ID的表。
现在我需要进行完整表扫描并仅读取这些键。我是需要分段读取还是可以一次性读取呢?
英文:
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
答案1
得分: 0
每个请求都使用Cassandra驱动程序进行分页(默认页面为5000)。然后,您遍历页面(或使用resulSet中的迭代器一个接一个地获取页面)。
对于像您提到的全表扫描表,推荐的方法是使用带有令牌映射的令牌范围/令牌感知查询,请参阅文档。
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论