【问题标题】:Cassandra pagination with c#使用 c# 进行 Cassandra 分页
【发布时间】:2012-06-23 20:28:54
【问题描述】:

当我为 MS SQL Server 进行分页以与 jquery 数据表一起使用时,我编写了一个像这样的简单 sp

create PROCEDURE [dbo].[Get_SomeData] (
@startRowIndex BIGINT, @maximumRows BIGINT ,@sSearch VARCHAR(MAX),@total INT OUTPUT
) 
AS 


DECLARE @temp TABLE(RowRank BIGINT,custid BIGINT,names VARCHAR(500))

INSERT INTO @temp
   SELECT ROW_NUMBER() OVER (ORDER BY custid) AS 
  RowRank,custid,names FROM dbo.SomeTable WHERE   (names LIKE '%'+@sSearch+'%'   )

   SELECT @total=COUNT(custid) FROM @temp

 SELECT *  FROM @temp  WHERE  RowRank > @startRowIndex 
 AND RowRank <= (@startRowIndex + @maximumRows)

这使得通过增加@startRowIndex 可以轻松地对数据进行分页。但是如何使用 Cassandra 数据库和像 fluentcassandra(或任何 c# 客户端库)这样的 c# 客户端来实现相同的分页功能

【问题讨论】:

    标签: c# pagination cassandra fluentcassandra


    【解决方案1】:

    Cassandra 分页是通过说“使用最后看到的值开始我的下一个结果集”来完成的,这比数字偏移/限制更有效。见http://blog.dynatrace.com/2011/12/05/pagination-with-cassandra-and-what-we-can-learn-from-it/

    【讨论】:

      猜你喜欢
      • 2015-04-24
      • 2015-02-22
      • 2019-10-12
      • 2020-03-06
      • 2018-05-18
      • 1970-01-01
      • 2020-04-03
      • 2012-08-03
      • 1970-01-01
      相关资源
      最近更新 更多