cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Lerer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-11310) Allow filtering on clustering columns for queries without secondary indexes
Date Wed, 16 Mar 2016 16:46:33 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-11310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15197656#comment-15197656
] 

Benjamin Lerer commented on CASSANDRA-11310:
--------------------------------------------

While reviewing your latest patch I realized that it is important to make sure that {{usesSecondaryIndexing}}
is properly set as it influences the way {{SelectStatement}} will process the queries. It
seems that it is already wrong today. If a query try to perform filtering with a {{CONTAINS}}
on a non-primary key column, {{SelectStatement}} will believe that an index is used even if
it is not the case. The query will be executed but not necessarily in the expected way and
the order by clause will be rejected :-(.

To make the code consistent I believe that {{StatementRestrictions}} should have an {{useFiltering}}
boolean variable, similar to {{usesSecondaryIndexing}}, to keep tract of the fact that the
query will perform filtering. It might be nice to expose it and have a test in {{SelectStatement::getRowFilter}}
to return an empty {{RowFilter}} if neither filtering nor secondary indices are used.

I do not think that the {{allowFiltering}} variable need to be stored as a field in {{StatementRestrictions}}.
It can be passed as a variable.

On the testing side, I think it would be good to:
* run your tests on {{COMPACT}} tables as well
* test with {{ORDER BY}} clauses for single and multi partition queries
* test with filtering on clustering columns and non-primary key columns / static columns

Problems tend to show up when several functionnalities are used together, so it is best to
test the combinations which seems a bit risky. :-) 

> Allow filtering on clustering columns for queries without secondary indexes
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-11310
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11310
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL
>            Reporter: Benjamin Lerer
>            Assignee: Alex Petrov
>              Labels: doc-impacting
>             Fix For: 3.x
>
>
> Since CASSANDRA-6377 queries without index filtering non-primary key columns are fully
supported.
> It makes sense to also support filtering on clustering-columns.
> {code}
> CREATE TABLE emp_table2 (
> empID int,
> firstname text,
> lastname text,
> b_mon text,
> b_day text,
> b_yr text,
> PRIMARY KEY (empID, b_yr, b_mon, b_day));
> SELECT b_mon,b_day,b_yr,firstname,lastname FROM emp_table2
> WHERE b_mon='oct' ALLOW FILTERING;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message