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 xreftable_idx_parent_id_ref_id ON XRefTable (parent_id,ref_id);
SELECT
*
FROM
Parent
WHERE
EXISTS (
SELECT
1
FROM
XRefTable
WHERE
(
XRefTable.ref_id IN (
2, 3
)
)
AND (
Parent.parent_id = XRefTable.parent_id
)
)