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:
CREATE INDEX employee_idx_firstname_lastname ON Employee (FirstName,LastName);
CREATE INDEX someothertable_idx_firstname_lastname ON SomeOtherTable (FirstName,LastName);
WITH CTE AS (SELECT
Employee.FirstName,
Employee.LastName,
count(*)
FROM
Employee
GROUP BY
Employee.FirstName,
Employee.LastName
HAVING
count(*) > 1) SELECT
1
FROM
SomeOtherTable AS sot
WHERE
sot.FirstName = cte.FirstName
AND sot.LastName = cte.LastName