cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Warren (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-4386) Allow cql to use the IN syntax on secondary index values
Date Sat, 19 Sep 2015 18:44:04 GMT


Steven Warren commented on CASSANDRA-4386:

I'd like to make a case for raising the priority of this JIRA. I have a use case which I don't
think should be that unusual and where a secondary index IN clause would be fantastic.

I have a set of wide rows ordered by an index (cluster key). I have a secondary key on the
primary column value.

If I want to look up a primary column value among the set of wide rows I have to issue a query
to each one:

select value from x where pk = :y and primary = :value

This is fine, the set of wide rows tends to be 1-100 rows so it's 1-100 parallel queries.
However, without the in clause it's 1-100 parallel queries per primary column row I want to
retrieve. It would be much better to just write:

select value from x where pk = :y and primary in :values

That gives me a fix number of queries to execute equal to the number of wide rows in the set.
This also should perform well since I'm specifying the partition key and sending the parallel
queries to the partition server for each one.

> Allow cql to use the IN syntax on secondary index values
> --------------------------------------------------------
>                 Key: CASSANDRA-4386
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Jeremy Hanna
>            Assignee: Benjamin Lerer
>            Priority: Minor
>              Labels: cql
> Currently CQL has a syntax for using IN to get a set of rows with a set of keys.  This
would also be very helpful for use with columns with secondary indexes on them.  Such as:
> {code}
> select * from users where first_name in ('fran├žois','frank');
> {code}

This message was sent by Atlassian JIRA

View raw message