You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by David Boxenhorn <da...@lookin2.com> on 2010/12/09 14:44:07 UTC

Secondary indexes change everything?

It seems to me that secondary indexes (new in 0.7) change everything when it
comes to data modeling.

- OOP becomes obsolete
- primary indexes become obsolete if you ever want to do a range query
(which you probably will...), better to assign a random row id

Taken together, it's likely that very little will remain of your old
database schema...

Am I right?

Re: Secondary indexes change everything?

Posted by Jonathan Ellis <jb...@gmail.com>.
On Thu, Dec 9, 2010 at 12:16 PM, David Boxenhorn <da...@lookin2.com> wrote:
> What do you mean by, "The included secondary indexes still aren't good at
> finding keys for ranges of indexed values, such as " name > 'b' and name <
> 'c' "."?
>
> Do you mean that secondary indexes don't support range queries at all?

http://www.riptano.com/blog/whats-new-cassandra-07-secondary-indexes

-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: Secondary indexes change everything?

Posted by David Boxenhorn <da...@lookin2.com>.
What do you mean by, "The included secondary indexes still aren't good at
finding keys for ranges of indexed values, such as " name > 'b' and name <
'c' "."?

Do you mean that secondary indexes don't support range queries at all?

Besides supporting range queries, I see the importance of secondary indexes
as solving the problem of really big indexes, which are almost (if not
completely) impossible to write by hand on the client.


On Thu, Dec 9, 2010 at 7:41 PM, Tyler Hobbs <ty...@riptano.com> wrote:

> OPP is not yet obsolete.
>
> The included secondary indexes still aren't good at finding keys for ranges
> of indexed values, such as " name > 'b' and name < 'c' ".  This is something
> that an OPP index would be good at.  Of course, you can do something similar
> with one or more rows, so it's not that big of an advantage for OPP.
>
> If you can make primary indexes useful, you might as well -- no reason to
> throw that away.
>
> The main thing that the secondary index support does is relieve you from
> having to write all of the indexing code and CFs by hand.
>
> - Tyler
>
>
> On Thu, Dec 9, 2010 at 8:23 AM, David Boxenhorn <da...@lookin2.com> wrote:
>
>> - OPP becomes obsolete (OOP is not obsolete!)
>> - primary indexes become obsolete if you ever want to do a range query
>> (which you probably will...), better to assign a random row id
>>
>> Taken together, it's likely that very little will remain of your old
>> database schema...
>>
>> Am I right?
>>
>>
>

Re: Secondary indexes change everything?

Posted by Tyler Hobbs <ty...@riptano.com>.
OPP is not yet obsolete.

The included secondary indexes still aren't good at finding keys for ranges
of indexed values, such as " name > 'b' and name < 'c' ".  This is something
that an OPP index would be good at.  Of course, you can do something similar
with one or more rows, so it's not that big of an advantage for OPP.

If you can make primary indexes useful, you might as well -- no reason to
throw that away.

The main thing that the secondary index support does is relieve you from
having to write all of the indexing code and CFs by hand.

- Tyler

On Thu, Dec 9, 2010 at 8:23 AM, David Boxenhorn <da...@lookin2.com> wrote:

> - OPP becomes obsolete (OOP is not obsolete!)
> - primary indexes become obsolete if you ever want to do a range query
> (which you probably will...), better to assign a random row id
>
> Taken together, it's likely that very little will remain of your old
> database schema...
>
> Am I right?
>
>

Re: Secondary indexes change everything?

Posted by David Boxenhorn <da...@lookin2.com>.
- OPP becomes obsolete (OOP is not obsolete!)
- primary indexes become obsolete if you ever want to do a range query
(which you probably will...), better to assign a random row id

Taken together, it's likely that very little will remain of your old
database schema...

Am I right?