You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (JIRA)" <ji...@apache.org> on 2014/03/31 16:59:15 UTC
[jira] [Commented] (CASSANDRA-6477) Partitioned indexes
[ https://issues.apache.org/jira/browse/CASSANDRA-6477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13955258#comment-13955258 ]
Jonathan Ellis commented on CASSANDRA-6477:
-------------------------------------------
bq. The problem is that this means we can't do lazy updates of the index; we need to keep the index perfectly (or, "eventually perfectly") in sync with the base table.
To clarify: Suppose you have you index on the age of users, and we have an entry for {{24: user1}} in the index table. Now two threads update user1's age; one to 25, and one to 26. Each thread will
# Read existing age
# Delete index entry for existing age
# Update user record and insert index entry for new age
The problem is if each thread reads the existing age of 24, then we'll end up with both {{25: user1}} and {{26: user1} index entries. (Atomic batches do not help with this.) With normal indexes, we clean up stale entries at compaction + read time; we could still do this here but the performance penalty is a lot higher.
Sylvain had another idea.
> Partitioned indexes
> -------------------
>
> Key: CASSANDRA-6477
> URL: https://issues.apache.org/jira/browse/CASSANDRA-6477
> Project: Cassandra
> Issue Type: New Feature
> Components: API, Core
> Reporter: Jonathan Ellis
> Fix For: 3.0
>
>
> Local indexes are suitable for low-cardinality data, where spreading the index across the cluster is a Good Thing. However, for high-cardinality data, local indexes require querying most nodes in the cluster even if only a handful of rows is returned.
--
This message was sent by Atlassian JIRA
(v6.2#6252)