I have a Set up with: 5 Cassandra node cluster with RF =3, I performed a secondary index for a column in the table 'user',
1) As per my study on Secondary Index using the link: https://www.datastax.com/dev/blog/cassandra-native-secondary-index-deep-dive I understood that secondary indexes will be stored in the local node. Does it mean that in the five node cluster only in one node the secondary index will be available? If not in the RF =3 for user table, In how many nodes the Secondary Index table will be available?
2) How does the following two query differ in execution?
CREATE TABLE user(
user_group int PRIMARY KEY,
user_name text,
user_phone varint
);
CREATE INDEX username_idx ON user (user_name);
In this table setup,
Query 1 : SELECT * FROM user WHERE user_name = 'test';
Query 2 : SELECT * FROM user WHERE user_group = 1 AND user_name = 'test';
How many nodes (In the 5 node cluster) will the above two queries pass through for execution and How the two queries differ in performance?
Edited :
Say I have a table like below,
CREATE TABLE nodestat (
uniqueId text,
totalCapacity int,
physicalUsage int,
flashMode text,
timestamp timestamp,
primary key (uniqueId, timestamp))
with clustering order by (timestamp desc);
CREATE CUSTOM INDEX nodeIp_idx ON nodestat(flashMode)
Query 3 : select * from nodestat where uniqueId = 'test' AND flashMode = 'yes'
So In this case, I always have only one partition in the table, so How does the secondary index search differ compare to the secondary index without partition key? How efficient is it?