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

Sergey Naumov commented on CASSANDRA-5470:
------------------------------------------

Then could you explain in documentation what are drawbacks of secondary indexes 
and how they are organized. Now it looks like secondary index implemented as 
additional hidden table tightly coupled with indexed table, but it is unclear 
why it is recommended not to use secondary index for big range values (like 
timestamp) and to use explicit table in this case. What are the differences 
between hidden and regular table and what are the threshold of such a range (is 
it normal to use secondary index on date (not a timestamp), or only on years). 
It is not clear how indexing helps if I have billion records and for each index 
value I have million records... How secondary index works with column slicing 
and composite columns...
                
> Query with condition on two secondary indexes can't be run without ALLOW 
> FILTERING.
> -----------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-5470
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5470
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.2.3
>         Environment: Apache Cassandra 1.2.3 installed from DataStax debian 
> repository.
>            Reporter: Sergey Naumov
>
> While manual explicitly suggests to use multiple secondary indices 
> (http://www.datastax.com/docs/1.2/ddl/indexes - Using multiple secondary 
> indexes), it is impossible to call such a query without ALLOW FILTERING 
> clause.
> I have the following table:
> cqlsh <<SQL
>     DROP TABLE k1.tbl1;
>     CREATE TABLE k1.tbl1 (
>         id timeuuid,
>         name varchar,
>         regid int,
>         date timestamp,
>         time timestamp,
>         payload varchar,
>         PRIMARY KEY (id)
>     );
>     CREATE INDEX tbl1_name
>         ON k1.tbl1 (name);
>     CREATE INDEX tbl1_regid
>         ON k1.tbl1 (regid);
>     CREATE INDEX tbl1_date
>         ON k1.tbl1 (date);
> SQL
> But when I'm trying to perform a query, error occured:
> cqlsh> select * from k1.tbl1 where regid = 2 and name = 'DB49';
> Bad Request: 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
> Perhaps you meant to use CQL 2? Try using the -2 option when starting cqlsh.
> With ALLOW FILTERING clause everything is OK.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to