cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-6960) Cassandra requires ALLOW FILTERING for a range scan
Date Tue, 01 Apr 2014 11:28:17 GMT

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

Sylvain Lebresne commented on CASSANDRA-6960:
---------------------------------------------

bq. It seems that Cassandra should be able to perform the following query without ALLOW FILTERING

Actually, it does require filtering, as we need to filter internally any partition that has
nothing matching the filter (see part of [that comment|https://issues.apache.org/jira/browse/CASSANDRA-4915]
on CASSANDRA-4915 too). More concretely, if you a million partition will each a million rows,
and none of rows in the table match the filter, the query will still take a very long time
to return no results, which is what ALLOW FILTERING is about warning you about.

> Cassandra requires ALLOW FILTERING for a range scan
> ---------------------------------------------------
>
>                 Key: CASSANDRA-6960
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6960
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: J.B. Langston
>
> Given this table definition:
> {code}
> CREATE TABLE metric_log_a (
>   destination_id text,
>   rate_plan_id int,
>   metric_name text,
>   extraction_date 'org.apache.cassandra.db.marshal.TimestampType',
>   metric_value text,
>   PRIMARY KEY (destination_id, rate_plan_id, metric_name, extraction_date)
> );
> {code}
> It seems that Cassandra should be able to perform the following query without ALLOW FILTERING:
> {code}
> select destination_id, rate_plan_id, metric_name, extraction_date, metric_value 
> from metric_log_a 
> where token(destination_id) > ? 
> and token(destination_id) <= ? 
> and rate_plan_id=90 
> and metric_name='minutesOfUse' 
> and extraction_date >= '2014-03-05' 
> and extraction_date <= '2014-03-05' 
> allow filtering;
> {code}
> However, it will refuse to run unless ALLOW FILTERING is specified.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message