Perfomrnace issue with RA_CUST_TRX_LINE_GL_DIST_ALL table
Hi,
I have a query on RA_CUST_TRX_LINE_GL_DIST_ALL table. For a particular period, query is taking 2-3 hrs to get the data.
I have tried to tune it in different ways but, no use. Below is the query.
******************************************************************************************************
SELECT ctlgd.org_id org_id, gcc.segment3 ACCOUNT
,SUM (to_number(decode(ctlgd.account_class, 'REC', decode(sign(nvl(ctlgd.amount,0)), -1,0,nvl(ctlgd.acctd_amount,0)), decode(sign(nvl(ctlgd.amount,0)), -1,-nvl(ctlgd.acctd_amount,0),0)))) - sum(to_number(decode(ctlgd.account_class, 'REC', decode(sign(nvl(ctlgd.amount,0)), -1,-nvl(ctlgd.acctd_amount,0),0), decode(sign(nvl(ctlgd.amount,0)), -1,0,nvl(ctlgd.acctd_amount,0)))))LOCAL_ACCTD_AMOUNT