SQL related common questions (Index fields)

1. Is it safe to purge records from the table (module_per_batch_instance)?

Yes, you can safely delete the records from module_page_batch table.

2. Is it possible to add an index to the field batch_instance_id on the table module_per_batch_instance to speed up select statements?

Yes you can index the batch_instance_id column of the module_per_batch_instance table and it will not cause any problem. Only thing is clean up and dashboard report jobs may take little more time to execute since insertion and deletion takes more time after applying indexes.

Future solution:

Please note that we are optimizing our clean up mechanism to clean data more frequently. This should fix blocking query problems. Part of it is already being done in 4502 version and rest will be catered in quarterly releases.