You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "YounwooKim (JIRA)" <ji...@apache.org> on 2013/06/21 02:21:21 UTC
[jira] [Updated] (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:all-tabpanel ]
YounwooKim updated CASSANDRA-5682:
----------------------------------
Description:
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 .
was:
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.
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira