Performance of a query
The below query is being used by a cursor in a stored procedure of a concurrent program.So the concurrent program is taking really long time to complete.
I am trying to find out ways to improve the performance of this query. Please help !!!
Query:
The table ccpe has
5943462 number of rows
(SELECT ccpe.location,
ccpe.client,
ccpe.due_date,
ccpe.prod,
ccpe.p_number,
ccpe.comm_type,
ccpe.product,
ccpe.loc,
ccpe.net_due,
(CASE
WHEN (TO_DATE (period, 'MON-YYYY') >= :v_cy_date_from
AND TO_DATE (period, 'MON-YYYY') <= :v_cy_date_to)
THEN
1
ELSE
0
END)
AS cy_factor,