Schema
CREATE TABLE books (
isbn text PRIMARY KEY,
author text
);
insert into books (isbn, author) values ('111', 'Sally');
insert into books (isbn, author) values ('112', 'Fred');
insert into books (isbn, author) values ('113', 'Joe');
With the above data, I am able to query via primary key 111
select * from books where isbn = '111';
However, when I put author in the where condition it throws error
select * from books where isbn = '111' and author = 'Fred';
Query 1 ERROR: Cannot execute this query as it might involve data filtering and thus may have unpredictable performance. If you want to execute this query despite the performance unpredictability, use ALLOW FILTERING
I am not able to understand that if the data is already filtered by the primary key (which is only one record) why does it throw an error ?
Second, if I use allow filtering is there any performance impact?
Edit: https://dzone.com/articles/apache-cassandra-and-allow-filtering has given me some clue.