Scylla: Support multi-column restrictions in ALLOW FILTERING

Created on 4 Jul 2018  路  7Comments  路  Source: scylladb/scylla

Currently ALLOW FILTERING does not implement multi-column restrictions, so it should be implemented with accompanying tests.

Note that multi-column EQ can be trivially split into a set of single column restrictions, but it's not so with IN and other restrictions.

Also note, that multi-column restrictions that include parts of primary keys or static row and regular columns should be handled with care, especially that filtering caches failed partition key and static row restrictions for a partition.

Refs #2025

CQL Field-Tier1 enhancement

Most helpful comment

People suffer from this bug. Please fix it as soon as possible.

All 7 comments

People suffer from this bug. Please fix it as soon as possible.

@psarna - will your change support the following as well

Create table tbl(id int, a text, b text, primary key ((id,a)));

Insert into tbl(id, a, b) values (1, 'a', 'b');
Insert into tbl(id, a, b) values (2, 'a', 'b');

Select * from tbl where id=1 and token(id,a) > 0 allow filtering

@avnerbarr (fyi)

Thanks - just to clarify,
I want to do "efficient full table scan" per the blog post (https://www.scylladb.com/2017/02/13/efficient-full-table-scans-with-scylla-1-6/)

but while filtering on part of the partition key partition key = ((col1,col2))

select * from t1 where col1=k11 and token(col1) >= lower_range and token(col1) < upper_range allow filtering
+------+------+------+
| Col1 | Col2 | Col3 |
+------+------+------+
| k11  | k21  |  ... |
| ...  | ...  |  ... |
| k11  | k22  |  ... |
| ...  | ...  |  ... |
| k12  | ...  |  ... |
| ...  | ...  |  ... |
+------+------+------+

This change enables only multiple comparisons and multiple IN-relations and it doesn't touch token restrictions. Right now the column cannot have both token and normal relations (it will result in error message Columns XXX cannot be restricted by both a normal relation and a token relation) - it should be a separate issue.

@psarna please file it then. It makes filtering scans impossible.

Is this still relevant? #6200 suggests that multi-column relations are possible (though buggy) with ALLOW FILTERING.

@dekimir is what relevant? This issue is closed since Feb 19.

Was this page helpful?
0 / 5 - 0 ratings