CQL SELECT greater-than query on indexed non-key column

前端 未结 3 791
时光说笑
时光说笑 2021-01-12 05:40

EDIT1: added a case to describe the problem after the original question.

I wish to query on a column which is not part of my key. If I understand correctly, I need t

3条回答
  •  心在旅途
    2021-01-12 05:56

    PRIMARY KEY (KeyA, KeyB) );

    CREATE INDEX ON Table1 (ValueA);

    SELECT * FROM Table1 WHERE ValueA > 3000;

    The Cassandra way is to have some partition key and always use that, with a clustering column for ValueA possibly PRIMARY KEY ((KeyA, KeyB), ValueA) and then use like:

    select * from Table1 where KeyA='xx' and ValueA > 3000

提交回复
热议问题