以下のようなテーブルがあります: CREATE TABLE test ( a int; b int; c int; d int; PRIMARY KEY () );
0 < a < 10 および 0 < b < 10 のデータを選択したいのですが、PRIMARY KEY の設定方法と CQL クエリの実行方法を教えてください。
ありがとう!
以下のようなテーブルがあります: CREATE TABLE test ( a int; b int; c int; d int; PRIMARY KEY () );
0 < a < 10 および 0 < b < 10 のデータを選択したいのですが、PRIMARY KEY の設定方法と CQL クエリの実行方法を教えてください。
ありがとう!
パフォーマンスに関連するいくつかの欠点がある ByteOrderedPartitioner を使用しない限り、パーティショニング キーで範囲演算子 (< >) を使用することはできません。
それ以外の場合、デフォルトの Murmur3Partitioner では、2 つのオプションがあります。最初の解決策:
create table test (
a int,
b int,
c int,
d int,
primary key ((a,b))
);
次に、1..10 の X について
select * from test where a = X and b in (1,2,3,4,5,6,7,8,9,10)
2番目の解決策:
create table test (
a int,
b int,
c int,
d int,
primary key (a,b)
);
それで
select * from test where a in (1,2,3,4,5,6,7,8,9,10) and b >=1 and b <= 10 ;