I re-wrote a query to reduce the time it takes to pick the records. But still i see that there is a small tuning that needs to be done in the decode line as the cost is high