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 `Table1` ADD INDEX `table1_idx_col2_col3_col5` (`Col2`,`Col3`,`Col5`);
ALTER TABLE `Table1` ADD INDEX `table1_idx_col2_col3_col4` (`Col2`,`Col3`,`Col4`);
ALTER TABLE `Table1` ADD INDEX `table1_idx_col1` (`Col1`);
SELECT
SUM(internal_agg_count)
FROM
((SELECT
COUNT(*) AS internal_agg_count
FROM
Table1
WHERE
(
Table1.Col2 = 'xyz'
AND Table1.Col3 = 'mnl'
AND Table1.Col5 = 'ijk'
))
UNION
DISTINCT (SELECT
COUNT(*) AS internal_agg_count
FROM
Table1
WHERE
(Table1.Col2 = 'xyz'
AND Table1.Col3 = 'mnl'
AND Table1.Col4 = 'efg'))
UNION
DISTINCT (SELECT
COUNT(*) AS internal_agg_count
FROM
Table1
WHERE
Table1.Col1 = 'abc')
) AS union1