cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Angilella (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-5125) Support indexes on composite column components (clustered columns)
Date Mon, 20 Oct 2014 20:46:35 GMT


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.

   userID uuid,
   fname text,
   zip int,
   state text,
  PRIMARY KEY ((userID, fname))

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

> Support indexes on composite column components (clustered columns)
> ------------------------------------------------------------------
>                 Key: CASSANDRA-5125
>                 URL:
>             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}
>   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

View raw message