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

Yuki Morishita commented on CASSANDRA-3680:
-------------------------------------------

I ran couple of test with above _blogs_ CF(index is created on _author_).

First, insert 3 rows below:
{code}
cqlsh:3680> INSERT INTO blogs (blog_id, posted_at, author, content) VALUES (1, 
'2012-11-11', 'foo', 'bar');
cqlsh:3680> INSERT INTO blogs (blog_id, posted_at, author, content) VALUES (2, 
'2012-11-12', 'foo', 'baz');
cqlsh:3680> INSERT INTO blogs (blog_id, posted_at, author, content) VALUES (3, 
'2012-11-11', 'gux', 'quux');
cqlsh:3680> SELECT * FROM blogs;
 blog_id | posted_at                | author | content
---------+--------------------------+--------+---------
       1 | 2012-11-11 00:00:00-0600 |    foo |     bar
       2 | 2012-11-12 00:00:00-0600 |    foo |     baz
       3 | 2012-11-11 00:00:00-0600 |    gux |    quux
{code}

Select on indexed column works fine:
{code}
cqlsh:3680> SELECT * FROM blogs WHERE author='foo';
 blog_id | posted_at                | author | content
---------+--------------------------+--------+---------
       1 | 2012-11-11 00:00:00-0600 |    foo |     bar
       2 | 2012-11-12 00:00:00-0600 |    foo |     baz
{code}

But, query combined with primary key(2nd query below) is not working as 
expected:
{code}
cqlsh:3680> SELECT * FROM blogs WHERE posted_at='2012-11-11';
 blog_id | posted_at                | author | content
---------+--------------------------+--------+---------
       1 | 2012-11-11 00:00:00-0600 |    foo |     bar
       3 | 2012-11-11 00:00:00-0600 |    gux |    quux

cqlsh:3680> SELECT * FROM blogs WHERE posted_at='2012-11-11' AND author='foo';
 blog_id | posted_at                | author | content
---------+--------------------------+--------+---------
       1 | 2012-11-11 00:00:00-0600 |    foo |     bar
       2 | 2012-11-12 00:00:00-0600 |    foo |     baz
{code}
Here, I expected only row with blog_id=1, but both 1 and 2 are returned.
                
> Add Support for Composite Secondary Indexes
> -------------------------------------------
>
>                 Key: CASSANDRA-3680
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3680
>             Project: Cassandra
>          Issue Type: Sub-task
>            Reporter: T Jake Luciani
>            Assignee: Sylvain Lebresne
>              Labels: cql3, secondary_index
>             Fix For: 1.2
>
>         Attachments: 0001-Secondary-indexes-on-composite-columns.txt
>
>
> CASSANDRA-2474 and CASSANDRA-3647 add the ability to transpose wide rows 
> differently, for efficiency and functionality secondary index api needs to be 
> altered to allow composite indexes.  
> I think this will require the IndexManager api to have a 
> maybeIndex(ByteBuffer column) method that SS can call and implement a 
> PerRowSecondaryIndex per column, break the composite into parts and index 
> specific bits, also including the base rowkey.
> Then a search against a TRANSPOSED row or DOCUMENT will be possible.
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to