Order by clause taking too much of time
542647Jan 19 2011 — edited Jan 21 2011Hi,
I have one query with union all clause and Ordered Hint in both query (Before and After Union all clause). Now the query is giving output in 6 seconds and fetching ~1 million records. When I add order by clause, it takes somewhere around 210 seconds.
By adding Order By clause, it should not use this much of time. What can be the reason and how to optimize order by clause.
Thanks