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

Denis Angilella commented on CASSANDRA-5125:
--------------------------------------------

??Lastly, I'll note that the patches only add theses news indexes for non 
compact tables. We should generalize to compact tables too, but that would 
require a bit of generalization that I'd rather add in a second phase.??

With 2.1 and *compact* tables it is possible to CREATE INDEX on composite 
primary key columns, but queries returns no results for the tests below.
Adding this comment for now, can open a new ticket if you prefer.

{code:SQL}
CREATE TABLE users2 (
   userID uuid,
   fname text,
   zip int,
   state text,
  PRIMARY KEY ((userID, fname))
) WITH COMPACT STORAGE;

CREATE INDEX ON users2 (userID);
CREATE INDEX ON users2 (fname);

INSERT INTO users2 (userID, fname, zip, state) VALUES 
(b3e3bc33-b237-4b55-9337-3d41de9a5649, 'John', 10007, 'NY');

// the following queries returns 0 rows, instead of 1 expected
SELECT * FROM users2 WHERE fname='John'; 
SELECT * FROM users2 WHERE userid=b3e3bc33-b237-4b55-9337-3d41de9a5649;
SELECT * FROM users2 WHERE userid=b3e3bc33-b237-4b55-9337-3d41de9a5649 AND 
fname='John';

// dropping 2ndary indexes restore normal behavior
{code}

> Support indexes on composite column components (clustered columns)
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-5125
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5125
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Jonathan Ellis
>            Assignee: Sylvain Lebresne
>             Fix For: 2.0 beta 1
>
>         Attachments: 0001-Refactor-aliases-into-column_metadata.txt, 
> 0002-Generalize-CompositeIndex-for-all-column-type.txt, 
> 0003-Handle-new-type-of-IndexExpression.txt, 
> 0004-Handle-partition-key-indexing.txt
>
>
> Given
> {code}
> CREATE TABLE foo (
>   a int,
>   b int,
>   c int,
>   PRIMARY KEY (a, b)
> );
> {code}
> We should support {{CREATE INDEX ON foo(b)}}.



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

Reply via email to