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 `married_couples` ADD INDEX `married_couples_idx_id1_id2` (`id1`,`id2`);
ALTER TABLE `matchmaker` ADD INDEX `matchmaker_idx_id` (`id`);
ALTER TABLE `people` ADD INDEX `people_idx_id` (`id`);
SELECT
a.id,
b.id,
e.id1,
e.id2
FROM
matchmaker AS a,
matchmaker AS b,
people AS c,
people AS d,
married_couples AS e
WHERE
e.id1 = c.id
AND c.id = a.id
AND e.id2 = d.id
AND d.id = b.id