question

debasis.tcs_69445 avatar image
debasis.tcs_69445 asked debasis.tcs_69445 published

Do we need to rebuild indexes when we do lots of INSERTs or DELETEs?

DO we need to rebuild index time to time if there is many insert and deletes happen in the tables which has custom indexes

cassandraindex
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

smadhavan avatar image
smadhavan answered debasis.tcs_69445 published

@debasis.tcs_69445, can you elaborate by updating your question about what index are you using in here and the version of DSE/OSS C*? In general indexes are built automatically and you don't have to do anything in particular. See this documentation for additional details. Thanks!

3 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

debasis.tcs_69445 avatar image debasis.tcs_69445 commented ·

We have few custom indexes on the cassandra tables. Developers are telling that these custom indexes get fragmented as data is being purged and inserted in regular interval.

Is it possible that custom indexes gets fragmented in that scenario and we need to manually rebuild the index to make select query faster?

0 Likes 0 ·
smadhavan avatar image smadhavan ♦ debasis.tcs_69445 commented ·

@debasis.tcs_69445, again you have not given additional details as to which version DSE/C* and what type of index(es) you're using. Please refer to this documentation to understand what are the problems using an index on a frequently updated or deleted column.

0 Likes 0 ·
debasis.tcs_69445 avatar image debasis.tcs_69445 smadhavan ♦ commented ·

Here is index details:-


CREATE INDEX idx_jobs_by_urn_jobcreationtimestamp ON m2mdm_jobs.jobs_by_urn (jobcreationtimestamp);

CREATE INDEX idx_jobs_by_urn_status ON m2mdm_jobs.jobs_by_urn (status);

CREATE INDEX idx_jobs_by_urn_v470_owner_app_node ON m2mdm_jobs.jobs_by_urn (v470_owner_app_node);

CREATE INDEX idx_jobs_by_urn_jobmode ON m2mdm_jobs.jobs_by_urn (jobmode);

CREATE INDEX idx_jobs_by_urn_v470_trigger_type ON m2mdm_jobs.jobs_by_urn (v470_trigger_type);

CREATE INDEX idx_jobs_by_urn_v470_scheduled_execution_time ON m2mdm_jobs.jobs_by_urn (v470_scheduled_execution_time);


Cassandra version is:- 3.11.0

Please let me know any thing more needed.

0 Likes 0 ·
Erick Ramirez avatar image
Erick Ramirez answered

The quick answer is no. Cassandra automatically indexes all mutations coming into the database. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.