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:
SELECT
some_field,
some_other_field
FROM
(SELECT
*
FROM
some_view a
WHERE
a.some_criteria
AND a.client_no || ':' || a.engagement_no || ':' || a.registered_date = (
SELECT
b.client_no || ':' || b.engagement_no || ':' || MAX(b.registered_date)
FROM
some_view b
JOIN
some_engagement_view e
ON e.client_no = b.client_no
AND e.engagement_no = b.engagement_no
JOIN
some_client_view c
ON c.client_no = b.client_no
WHERE
some_other_criteria
AND b.client_no = a.client_no
AND b.engagement_no = a.engagement_no
GROUP BY
b.client_no,
b.engagement_no
)
)