f*****e 发帖数: 2992 | 1 【 以下文字转载自 DataSciences 讨论区 】
发信人: fatalme (don't ever give it up), 信区: DataSciences
标 题: 这个cassandra paging的解决方案怎么样?
发信站: BBS 未名空间站 (Fri Sep 26 15:52:43 2014, 美东)
As paging is a big issue of Cassandra. I have a strategy to page using
secondary index: Add a column "page_number" corresponding to each column you
want to sort and page, create an index on the "page_number" column or just
use it as the clustering column. The "page_number" is a good candidate for
indexing, since it has low cardinality: every entry in the same page has the
same page number. If there are 100 entries in one page, then there are 100
entries with the same page number. Thus is low cardinality. We can order the
entries according to each column and set the corresponding "page_number".
You can retrieve one page and do the corresponding sorting and send to
display. Is this a good way or not? |
|