April 7, 2025 at 12:00 am
Comments posted to this topic are about the item Understanding UNION and UNION ALL in SQL Server
April 7, 2025 at 11:56 am
Thank you for this clear write-up!
There is one important thing to add, which is the difference in the difference in the implementation / execution of those two operators.
UNION ALL implies a select operation from each table and then a set concatenation, UNION does the same with the addition of a DISTINCT SORT operator that is a blocking operation, can seriously affect performance on large data sets. The point here is NOT to use UNION but as for the last resort in deduplication the result sets, plenty of more efficient ways are available.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy