How can I optimize the performance of this query?
SELECT Count(DISTINCT DT.id)
FROM pcwdeptrans DT
INNER JOIN pcwitemtotal IT
ON DT.id = IT.deposittransid
LEFT OUTER JOIN pcwdepreceipt DR
ON DR.deposittransid = DT.id
WHERE (( ( DT.statecode IN ( :1, :2, :3, :4,
:5, :6, :7, :8 )
OR ( DT.statecode IN ( :9 )
AND IT.statecode = :10 ) )
AND DR.requesttime >= :11
AND DR.requesttime <= :12
AND DR.userid = :13 ))
Please help me with the right syntax if you think its incorrect.
But this is an application query, identified from the AWR report as part of performance analysis