Reader small image

You're reading from  Cassandra 3.x High Availability - Second Edition

Product typeBook
Published inAug 2016
Reading LevelIntermediate
Publisher
ISBN-139781786462107
Edition2nd Edition
Languages
Right arrow
Author (1)
Robbie Strickland
Robbie Strickland
author image
Robbie Strickland

Robbie Strickland has been involved in the Apache Cassandra project since 2010, and he initially went to production with the 0.5 release. He has made numerous contributions over the years, including work on drivers for C# and Scala and multiple contributions to the core Cassandra codebase. In 2013 he became the very first certified Cassandra developer, and in 2014 DataStax selected him as an Apache Cassandra MVP. Robbie has been an active speaker and writer in the Cassandra community and is the founder of the Atlanta Cassandra Users Group. Other examples of his writing can be found on the DataStax blog, and he has presented numerous webinars and conference talks over the years.
Read more about Robbie Strickland

Right arrow

Multi-key queries


You will recall from the last chapter that Cassandra is most efficient when querying a range of columns on disk. All our examples assumed a replication factor of 3 with QUORUM reads and writes. We will follow the same conventions with the examples in this chapter.

With this in mind, let's make use of the authors schema we introduced in the last chapter:

CREATE TABLE authors ( 
   name text, 
   year int, 
   title text, 
   publisher text, 
   isbn text, 
   PRIMARY KEY (name, year, title) 
); 

Using this schema, let's say we want to retrieve a number of books from a list of known authors. Obviously, we could write a separate query for each author, but Cassandra also provides a familiar SQL-style syntax for specifying multiple partition keys using the IN clause:

SELECT * FROM authors 
WHERE name IN ( 
    'Tom Clancy', 
    'Malcolm Gladwell', 
    'Dean Koontz' 
); 

The question is: how will Cassandra fulfill this request? As we have discussed numerous times throughout this...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Cassandra 3.x High Availability - Second Edition
Published in: Aug 2016Publisher: ISBN-13: 9781786462107

Author (1)

author image
Robbie Strickland

Robbie Strickland has been involved in the Apache Cassandra project since 2010, and he initially went to production with the 0.5 release. He has made numerous contributions over the years, including work on drivers for C# and Scala and multiple contributions to the core Cassandra codebase. In 2013 he became the very first certified Cassandra developer, and in 2014 DataStax selected him as an Apache Cassandra MVP. Robbie has been an active speaker and writer in the Cassandra community and is the founder of the Atlanta Cassandra Users Group. Other examples of his writing can be found on the DataStax blog, and he has presented numerous webinars and conference talks over the years.
Read more about Robbie Strickland