From the course: Cassandra Data Modeling Essential Training

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Secondary indexes

Secondary indexes

- [Instructor] We design Cassandra tables to answer specific queries. Ideally, our tables can be used to answer multiple queries. Sometimes this falls out naturally, for example, in this table called devices, we can answer queries about devices and their installation year as well as devices and their installation date. Let's modify the table to include the name of the server manufacturer. Now we have a table that has information about devices, location, installation date, and manufacturer. The table uses installation year as a partition key. So that determines which node stores the data. It uses installation date and ID as a clustering key. With this, we can look up rows in the table using the primary key. But if we want to select results by manufacturer name, we can't do it with that table definition. We could create another table and cluster by manufacturer with this command. This solution solves the selecting problem…

Contents