incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <>
Subject Re: Creating and using indices
Date Fri, 08 Oct 2010 17:21:23 GMT
On Fri, Oct 8, 2010 at 9:27 AM, Christian Decker
<> wrote:
> On Thu, Oct 7, 2010 at 6:25 PM, Jonathan Ellis <> wrote:
>> No, LT[E] is not on the roadmap for primary index clauses (GT[E] is,
>> for 0.7.1).  So you would want to create an index with an inverted
>> comparator, to turn LTE into GTE.
> Hm, sounds rather strange, but that would mean that I'd either be able to
> select GT[E] or LT[E], not combining both, right? So expressions like 123 <
> uid < 321 would be completely impossible.

No, you only need one primary index clause to avoid the full CF scan.
After that you can have subordinate clauses on basically anything.  so
uid > 123 would be the primary and uid < 321 would be subordinate, and
that would be fine.  (just like now you can have uid=123 and x > foo.)

> How would one proceed to create an
> index with an inverted comparator? I'd have to create my own Sub-Type on
> which I'd invert compare function.

Right, although I think this would be common enough that we'd either
provide reversed comparators or add a "reversed" option to the index

Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support

View raw message