DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

debasis.tcs_69445 avatar image
debasis.tcs_69445 asked ·

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 characters needed characters left characters exceeded

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, 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 characters needed characters left characters exceeded

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

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 ·

@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 · ·

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 characters needed characters left characters exceeded

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