Problem fixing missing indexes after upgrade to 4.7
We have found that there are problems with both civicrm_option_value and civicrm_case_contact table indexes that have not been properly fixed by https://github.com/civicrm/civicrm-core/pull/10908 as of 4.7.25 or the rc's for 4.7.26 and 4.7.27 as of late October 2017. 

When we encounter this we have been runing the following queries in the relevant MySQL database:

ALTER table civicrm_option_value DROP FOREIGN KEY  FK_civicrm_option_value_option_group_id;
ALTER table civicrm_option_value DROP INDEX index_option_group_id_name;
ALTER table civicrm_option_value ADD CONSTRAINT `FK_civicrm_option_value_option_group_id` FOREIGN KEY (`option_group_id`) REFERENCES `civicrm_option_group`(`id`) ON DELETE CASCADE;

ALTER table civicrm_case_contact DROP FOREIGN KEY FK_civicrm_case_contact_contact_id;
ALTER table civicrm_case_contact DROP INDEX FK_civicrm_case_contact_contact_id;
ALTER table civicrm_case_contact DROP FOREIGN KEY FK_civicrm_case_contact_case_id;
ALTER table civicrm_case_contact DROP INDEX UI_case_contact_id;
ALTER TABLE `civicrm_case_contact`
  ADD CONSTRAINT `FK_civicrm_case_contact_case_id` FOREIGN KEY (`case_id`) REFERENCES `civicrm_case` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_civicrm_case_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;


After running these queries, we go to the Admin Status Console (civicrm/a/#/status) and click the button that calls the UpdateIndices api, which rebuilds the indexes properly. (In other words, we have not found that @Alan Dixon's step 4 is required after step 3.)

There are reports that some people have duplicate entries in civicrm_case_contact table on case_id and contact_id. You'll need to delete these duplicates.