SELECT NVL(SUM(TRN.ACCRUALPTS), 0) AS ACCRUALPTS
FROM TrsanctionTable REQ INNER JOIN
TRSANCTIONTABLEREQ TRN ON TRN.TRNREQID = REQ.TRNREQID INNER JOIN
CARDTABLE CARD ON CARD.CARDID = TRN.CARDID
WHERE TRN.CUSTOMERID = 4082
AND TRN.STATUSCODE = '2220'
AND REQ.STATUSCODE = '00'
AND TRN.BATCHID IS NULL;
Above Query which is taking much time to execute, Could you suggest me that how I can rewrite or change this query to run faster. My team suggest to Add composite index on this query.
Is their anything else that can work to reduce the cost of this QUERY
COST OF THIS QUERY IS 102K
NOTE: Indexing Already Apply on Single columns.
/*+GATHER_PLAN_STATISTICS*/
hint and paste a textual output fromselect * from table(dbms_xplan.display_cursor(format => 'BASIC +PREDICATE ALLSTATS LAST'))
which should be executed just after your query.