cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Lerer (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-11031) MultiTenant : support “ALLOW FILTERING" for Partition Key
Date Tue, 23 Aug 2016 08:25:20 GMT


Benjamin Lerer commented on CASSANDRA-11031:

Overall the patch looks good to me. I just have noted the following points:
* The {{hasSlice}} method is now duplicated in {{PartitionKeySingleRestrictionSet}} and {{ClusteringColumnRestrictions}}.
It would be better to put it only into {{RestrictionSet}} and expose it into {{Restrictions}}.
* We should have some unit test for MaterializedViews with Slice and unrestricted partition
* In {{StatementRestrictions::processPartitionKeyRestrictions}} I do not think that the error
message: {{"Partition key parts: %s must be restricted as other parts are"}} makes sense any
more (for non-MVs). We should probably only use the {{ALLOW FILTERING}} error message.
* The part of {{StatementRestrictions::processPartitionKeyRestrictions}} dealing with secondary
index can probably be combined with the one dealing with the filtering.
* In {{RowFilter}} we should not use Lambda expression to filter out the rows as they are
pretty bad from the performance point of view and result in a lot of garbage.
* In {{RowFilter}}: {{Iterables.size(rowLevelExpressions)}} can be replaced by {{rowLevelExpressions.size()}}
* The tests using secondary indices should be put into {{SecondaryIndexTest}}
* It will be good to add more tests into {{SelectOrderedPartitionerTest::testFilteringOnPartitionKeyWithToken}}:
with {{>}} on one of the partition key or only the second partition key being specified
* In {{SelectTest::testAllowFilteringOnPartitionKey}} the message {{IN restrictions are not
supported on indexed columns}} looks wrong to me as the test do not use any secondary index.

> MultiTenant : support “ALLOW FILTERING" for Partition Key
> ---------------------------------------------------------
>                 Key: CASSANDRA-11031
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: CQL
>            Reporter: ZhaoYang
>            Assignee: ZhaoYang
>            Priority: Minor
>             Fix For: 3.x
> Currently, Allow Filtering only works for secondary Index column or clustering columns.
And it's slow, because Cassandra will read all data from SSTABLE from hard-disk to memory
to filter.
> But we can support allow filtering on Partition Key, as far as I know, Partition Key
is in memory, so we can easily filter them, and then read required data from SSTable.
> This will similar to "Select * from table" which scan through entire cluster.
> CREATE TABLE multi_tenant_table (
> 	tenant_id text,
> 	pk2 text,
> 	c1 text,
> 	c2 text,
> 	v1 text,
> 	v2 text,
> 	PRIMARY KEY ((tenant_id,pk2),c1,c2)
> ) ;
> Select * from multi_tenant_table where tenant_id = "datastax" allow filtering;

This message was sent by Atlassian JIRA

View raw message