You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT COUNT(R.RESOURCE_ID) FROM Basic_LOGICAL_RESOURCES LR
JOIN Basic_RESOURCES R
ON R.LOGICAL_RESOURCE_ID=LR.LOGICAL_RESOURCE_ID
AND R.RESOURCE_ID = LR.CURRENT_RESOURCE_ID AND R.IS_DELETED <> 'Y'
JOIN (SELECT DISTINCT LOGICAL_RESOURCE_ID FROM Basic_TOKEN_VALUES
WHERE (PARAMETER_NAME_ID=39 AND ((TOKEN_VALUE = ?)))) Basic0
ON Basic0.LOGICAL_RESOURCE_ID = R.LOGICAL_RESOURCE_ID
The DISTINCT in the sub-query might prevent the optimizer from picking a better plan. Consider using EXISTS and correlate the sub-query (without distinct) with the main body. Semantically the result should be the same.
To Reproduce
Run JDBCPagingTest as an example.
Expected behavior
Best possible performance. Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Verified during Code Review, the queries do not generate the DISTINCT and use the EXISTS approach to counting. As discussed on the Team call, I am closing this issue.
Describe the bug
The DISTINCT in the sub-query might prevent the optimizer from picking a better plan. Consider using
EXISTS
and correlate the sub-query (without distinct) with the main body. Semantically the result should be the same.To Reproduce
Run JDBCPagingTest as an example.
Expected behavior
Best possible performance.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: