Need to improve the running time of the SP. Need help.
The SP runs fine and is giving the expected results. However, it is taking a lot of time to complete and my task is to reduce the runnigntime and improve the performance.
I've tried different options like creating indices on the temp tables before selecting data from them, converting case statements in the 'WHERE' CLAUSE into 'BOOLEAN' EXPRESSIONS.
However, the problem still persists with the execition time.