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
IDAudit,
TableName,
dbo_Audit.RowID,
ChangeDate,
IDAPSCase
FROM
dbo_APSCEI
INNER JOIN
(
dbo_Audit
INNER JOIN
dbo_TableType
ON dbo_Audit.IDTableType = dbo_TableType.IDTableType
)
ON dbo_APSCEI.IDAPSCEI = dbo_Audit.RowID
WHERE
(
(
(
TableName
) = "APSCEI"
)
AND (
IDAPSCase = 379017
)
)
UNION
SELECT
IDAudit,
TableName,
RowID,
ChangeDate,
IDAPSCase
FROM
dbo_APCSUN
INNER JOIN
(
dbo_Audit
INNER JOIN
dbo_TableType
ON dbo_Audit.IDTableType = dbo_TableType.IDTableType
)
ON dbo_APCSUN.IDAPCSUN = dbo_Audit.RowID
WHERE
(
(
(
TableName
) = "APCSUN"
)
AND (
IDAPSCase = 379017
)
)
UNION
SELECT
IDAudit,
TableName,
RowID,
ChangeDate,
IDAPSCase
FROM
dbo_APSCAI
INNER JOIN
(
dbo_Audit
INNER JOIN
dbo_TableType
ON dbo_Audit.IDTableType = dbo_TableType.IDTableType
)
ON dbo_APSCAI.IDAPSCAI = dbo_audit.RowID
WHERE
(
(
(
TableName
) = "APSCAI"
)
AND (
IDAPSCase = 379017
)
)
ORDER BY
ChangeDate DESC,
IDAPSCase