Getting Started with Adobe After Effects - Part 6: Motion Blur
This module helps you to share, discuss and learn interview questions and answers of different technologies

SQL Server - Which is faster? Union or Union All?

May 8 2012 12:00AM by Nirav Gandhi   

Question

Recently i received a question in SQL Server, "Which is faster Union or Union All?"

Answer

Answer : Union All is Faster then Union.

UNION -> you get DISTINCT records from both the tables.

UNION ALL-> Get all records from both the tables with duplicates.

If you check execution plan, UNION has extra "sort" operator, which makes it costlier compared to "UNION ALL". However, it's necessary sometimes to use "UNION", if the data sources has duplicate records and we wants to avoid duplicates.

Read More..   [32134 clicks]

Published under: SQL Server Interview Questions ·  ·  ·  · 


Nirav Gandhi
38 · 5% · 1503
0
Liked
 
0
Asked



Submit

Your Comment


Sign Up or Login to post a comment.

"SQL Server - Which is faster? Union or Union All?" rated 5 out of 5 by 5 readers
SQL Server - Which is faster? Union or Union All? , 5.0 out of 5 based on 5 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]