I think this isn't quite right. I think we only want to look at the indexes for the specified mapping types. We probably want to build a list of the indexes that are affected by the specified mapping types and use that throughout this function rather than `all_write_indexes()`.