In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
ALTER TABLE `wp_posts` ADD INDEX `wp_posts_idx_id` (`ID`);
ALTER TABLE `wp_term_relationships` ADD INDEX `wp_relationships_idx_term_id` (`term_taxonomy_id`);
ALTER TABLE `wp_term_taxonomy` ADD INDEX `wp_taxonomy_idx_term_id` (`term_id`);
ALTER TABLE `wp_terms` ADD INDEX `wp_terms_idx_term_id` (`term_id`);
SELECT
COUNT(*)
FROM
wp_posts
LEFT JOIN
wp_term_relationships
ON wp_posts.ID = wp_term_relationships.object_id
LEFT JOIN
wp_term_taxonomy
ON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
INNER JOIN
wp_terms
ON wp_term_taxonomy.term_id = wp_terms.term_id
WHERE
wp_terms.term_id = 195