【问题标题】:Cassandra db PHP driver, cannot page queries with both ORDER BY and a IN restriction on the partition keyCassandra db PHP 驱动程序,不能使用 ORDER BY 和对分区键的 IN 限制分页查询
【发布时间】:2018-11-06 06:34:19
【问题描述】:

我无法使用 datastax PHP 驱动程序获得以下查询的结果,

select * from track where id='35209' and day in (20180314,20180315,20180316) and datetime < '2018-03-15 11:00:00' order by datetime desc limit 1;

错误消息:“无法对分区键同时使用 ORDER BY 和 IN 限制的查询进行分页;您必须删除 ORDER BY 或 IN 并对客户端进行排序,或者禁用此查询的分页”

那么如何在“executeAsync”时禁用分页?

【问题讨论】:

    标签: php cassandra paging


    【解决方案1】:

    您可以通过在Cluster.Builder 对象上传递调用withDefaultPageSize 并将null 作为参数传递来禁用分页...

    【讨论】:

      【解决方案2】:

      CREATE TABLE 音乐(艺术家文本、专辑文本、tr_num int、歌曲文本、PRIMARY KEY((artist)、专辑、tr_num)),聚类顺序按 (album DESC ,tr_num DESC);

      【讨论】:

        猜你喜欢
        • 2018-04-05
        • 2019-08-31
        • 2017-06-25
        • 1970-01-01
        • 2022-08-10
        • 1970-01-01
        • 2016-09-07
        • 1970-01-01
        • 2021-11-22
        相关资源
        最近更新 更多