Tuesday, April 05, 2016

UNION makes ALL the strength




Following the advice from a very expert consultant, I changed my views from an UNION between two select from the same table to UNION ALL and the performance improvements were simply amazing. Before doing so, I had verified that the query were returning different results with the INTERSECT command before doing so.

The difference is that UNION verifies that records are unique, while UNION ALL doesn't. The performance gain is very remarkable 

No comments: