Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 用于查询多列表的Cassandra表模式_Java_Linux_Database_Database Design_Cassandra - Fatal编程技术网

Java 用于查询多列表的Cassandra表模式

Java 用于查询多列表的Cassandra表模式,java,linux,database,database-design,cassandra,Java,Linux,Database,Database Design,Cassandra,在Cassandra中,我在创建表模式时面临一个大问题。请提供最好的建议。 目前正在使用Cassandra 3.9版 我的桌子:- CREATE TABLE call ( date text, dt timestamp, calledno text, callerno text, calltype text, channelno int, comment text, dpc text, opc text, syste

在Cassandra中,我在创建表模式时面临一个大问题。请提供最好的建议。 目前正在使用Cassandra 3.9版

我的桌子:-

CREATE TABLE call (
    date text,
    dt timestamp,
    calledno text,
    callerno text,
    calltype text,
    channelno int,
    comment text,
    dpc text,
    opc text,
    systemno int,
    trackno int,
    traffictype text,
    id uuid,
    PRIMARY KEY (systemno,trackno,date,id)
) WITH CLUSTERING ORDER BY (trackno ASC,date ASC)
现在,我的搜索将基于以下类型:-

  • 仅DT(在单个日期,有时基于范围)
  • DT,系统号,轨道号
  • DT、OPC、DPC(适用于所有系统号和轨道号)
  • DT,评论
  • 卡勒诺
  • DT,CalledNo
  • DT,频道号
  • DT,CallerNo,CallerNo
  • 这个表上的写入负载非常高,大约每秒4k-5k insert记录


    需要知道可以创建多少最少的表或具体化视图,以最大的读取速度实现这些搜索。

    在为cassandra建模时,请毫不犹豫地创建表。根据您的查询设计表。嗨,Gunwant,谢谢您的回复,但我不太担心维护这么多表,所以希望尽可能减少配置。因此,同样需要一些建议。你需要提供更多的信息,比如DT、SystemNo、TrackNo——你想要唯一的单元号吗?好的。所以,我会举一个例子,比如我有3个系统号和2个轨道,所以对于系统和轨道的任何组合,我需要这个表中基于特定日期的所有数据。因此,基本上是的,每一行项目都是唯一的。在为cassandra建模时,请毫不犹豫地创建表。根据您的查询设计表。嗨,Gunwant,谢谢您的回复,但我不太担心维护这么多表,所以希望尽可能减少配置。因此,同样需要一些建议。你需要提供更多的信息,比如DT、SystemNo、TrackNo——你想要唯一的单元号吗?好的。所以,我会举一个例子,比如我有3个系统号和2个轨道,所以对于系统和轨道的任何组合,我需要这个表中基于特定日期的所有数据。所以基本上是的,每一行项目都是唯一的。