You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Rao (JIRA)" <ji...@apache.org> on 2013/12/30 23:04:50 UTC

[jira] [Commented] (CASSANDRA-5682) When the Cassandra delete keys in secondary Index?

    [ https://issues.apache.org/jira/browse/CASSANDRA-5682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13859121#comment-13859121 ] 

Rao commented on CASSANDRA-5682:
--------------------------------

Question: we are seeing some performance issues with some queries.. (only with specific inputs). The first query takes around 10sec, the second query comes back instantly. The column "routeoffer" has a secondary index. How can we check if we have a similar issues described in the ticket OR could it be some thing else? tried to repair and rebuild index, but it did not fix the issue.

cqlsh:topology> SELECT count(*) FROM ManagedResource WHERE routeoffer='JMETER' ALLOW FILTERING;
count
-------
137

cqlsh:topology> SELECT count(*) FROM ManagedResource WHERE routeoffer='DEFAULT' ALLOW FILTERING;

count
-------
161

> When the Cassandra delete keys in secondary Index?
> --------------------------------------------------
>
>                 Key: CASSANDRA-5682
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5682
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0.1
>         Environment: normal x86 PC (i3 CPU + 4GB ram) + Ubuntu 12.04
>            Reporter: YounwooKim
>            Priority: Minor
>
> How can i reduce the size of secondary index?
> Obviously, I delete many keys, and tried flush, compact, cleanup, rebuild_index using nodetool. However, i can't reduce the size of secondary index. ( Of course, the size of table(Primary key) is reduced. )
> Therefore, I found out the hint from the Cassandra source code, and I guess a feature of secondary index deletion.
> 1) When I request deletion of key, and the key is in the sstable(not in the memtable), the Cassandra doesn't insert the tombstone to the sstable for secondary index.( Unlike the table )
> ( from AbstractSimpleColumnSecondaryIndex.delete() function. )
> 2) After scaning the secondary index, the tombstone is maded in secondary index.
> ( from KeysSearcher.getIndexedIterator() function. It is called by index scan verb. )
> 3) Cleanup command in nodetool is used to delete out of range keys. ( Cleanup command don't care about deleted keys )
> ( from CompactionManager.doCleanupCompaction() function. )
> After this, I scan deleted keys using 'Where' clause, and I can reduce the size of secondary index. I think that it is only one way to reduce the size of secondary index.
> Is this a correct conclusion? I can't found related articles and other methods. 
> I think that the Cassandra needs the compaction function for secondary index .



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)