Many slow queries post_type = ‘attachment’;

This is bug #31071: media / post_mime_type related queries are very slow on larger sites. It should have been fixed for version 4.8 now.

You can try it on a test site that is a mirror of your production site. There are some very interesting ideas in that bug discussion. See if you can use some of them right now already, like adding an index.