Database Reference
In-Depth Information
select user_id from users where age =21;
user_id
--------------------------------------
498d9f00-d47f-11e3-be07-79e7dcea6dd7
(1 rows)
5.
Next, let's try to fetch users whose age is greater than 21:
select user_id from users where age >=21;
It results in the same error we saw in the preceding example:
Bad Request: No indexed columns present in by-columns
clause with Equal operator
Secondary indexes allow users to retrieve records using indexed columns with “=”
only. But still real-time applications would want to perform range queries over non-row
key columns.
Columns with low cardinality values are generally recommended for indexing as
probability of retrieving data from various nodes in a cluster is very high. Whereas a
column with high cardinality may result in performance overhead under high data load
and large Cassandra clusters. Indexes on unique columns should be fine in case data
volume is not huge. Also, you can turn on tracing to monitor queries on secondary in-
dexes. In general, tracing can be used for investigating CQL3 queries. You can turn on/
off tracing as
TRACING ON;
TRACING OFF;
From version 1.2 onward Cassandra provides composite column support. Using
composite column support it is possible to perform range scan over composite
columns.
Let's explore composite columns more in the next section.
Composite Columns
Search WWH ::




Custom Search