Backport: Remove unnecessary DB indexes
Backport of !687 (merged). I thought this would require a migration, but it looks like the unnecessary indexes are just aliases of the foreign key indexes they duplicate, so they can't be removed.
!690 (merged) may have to be rebased after this is merged.