Indexing tuples

In the previous section, we observed that it would not make much sense for a user to have a graduation year without also naming an educational institution; this provided a rather abstract motivation for grouping those two pieces of information together in a single column. A more practical motivation is the fact that, like any other column, tuples can be indexed.

Let's put an index on our education column; the syntax is no different from creating an index on any other column:

CREATE INDEX ON "users" ("education"); 

Armed with this index, we can now perform efficient lookup of user records based on their educational institution and year of graduation:

SELECT "username", "education" FROM users WHERE "education" = ('Big Data ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.