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 `categories_groups_cat1` ADD INDEX `categories_cat1_idx_id` (`id`);
ALTER TABLE `es_temp1` ADD INDEX `es_temp1_idx_categories_id` (`categories_groups_cat1_id`);
ALTER TABLE `es_temp2` ADD INDEX `es_temp2_idx_id` (`id`);
ALTER TABLE `es_temp3` ADD INDEX `es_temp3_idx_category_gr` (`category_gr`);
SELECT
cat1.id AS cat1id,
cat1.title_gr AS title,
cat1.order
FROM
categories_groups_cat1 AS cat1
INNER JOIN
es_temp1 AS vs
ON vs.categories_groups_cat1_id = cat1.id
INNER JOIN
es_temp2 AS cats
ON cats.id = vs.categories_id
INNER JOIN
es_temp3 AS offers
ON offers.category_gr = cats.title_gr
GROUP BY
cat1.id
ORDER BY
cat1.order ASC