SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Events
Classes
About Us
Login / Register
Subscribe RSS Feed 

Idera SQL Check

The Execution Plan for UNION

This introductory level video by Grant Fritchey takes a look at what happens within an execution plan when you have a UNION statement in your query.

Duration:
1 mins 11 secs
Skill Level:
100
Rating:
4.10 out of 5
Publish Date:
September 09, 2008
The Execution Plan for UNION You must be logged in to view this video.  
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Grant Fritchey
I'm currently working for FM Global, an industry leading engineering & insurance company, as a DBA. I've done development of large scale applications in languages such as VB, C# and Java. I've worked in SQL Server from the hoary days of 6.0. My nickname at work is the "The Scary DBA." I even have an official name plate with it. I wear it proudly. I was awarded a Microsoft MVP in April of '09.

References

There are no downloads or recommended reading links for this video

Comments
Alberto on 6/23/2009
Finally! a catchy learning experience

Marc Moshman on 6/23/2009
Why are there two union operations (1004 and 1005) ?

Steve Harris on 6/23/2009
was good but seemed incomplete. wanting more information.

245BE142DD on 6/23/2009
waste of time

325BD96788 on 6/23/2009
More in depth vids. regarding optimizing execution plans please!

Sara Karasik on 6/23/2009
Clear, but too elementary. Good for a real beginner, or introductory course.

Ahmad Elayyan on 6/23/2009
good

Tom B. on 6/23/2009
I am always up for learning new things about SQL.

jaiganesh on 6/23/2009
Voice not a clear and it would be explined in much better way

Grant Fritchey on 6/23/2009
Marc Moshman: The two defined values, 1004 and 1005, represent the two columns being unioned together.

Grant Fritchey on 6/23/2009
Sara Karasik: It was billed as a 100 level information, very basic. The goal on these little videos is just to provide enough information for people learning this stuff to understand a single topic. More advanced videos will need to be created.

Jamshid Nouri on 6/23/2009
excellent

suvankar on 6/24/2009
great video

Russell Miller on 6/24/2009
Pretty short--could expand more by discussing relative tradeoff between doing a Union or solving the problem using other techniques.

Tim Patterson on 6/24/2009
I like how this guys videos are succinct.

Gautam on 6/25/2009
I assume if this a performance issue, we should use UNION ALL and maybe a rownumber() to remove duplicates afterwards if only want distinct rows ?

Grant Fritchey on 6/26/2009
Gautam, you can, but you may just need to do a UNION. It really depends on the situation.

Saleem on 6/28/2009
Very Short

Aaditya Tarhalkar on 6/29/2009
It would have been helpful if you more explanation was provided about the Distinct Sort operator and how to avoid or minimise the cost of that operator.

Caleb Bell on 7/16/2009
Why is there a Distinct Sort operator as part of the UNION? Does UNION remove duplicate rows from the combined data set?

Grant Fritchey on 7/17/2009
UNION removes duplicates. UNION ALL does not. Frequently what's needed is UNION ALL. Using this will remove the need for an aggregate operation. The aggregate is occurring here just as it would in a DISTINCT or GROUP BY situation... it's eliminating the duplicate values.

UB on 7/20/2009
Want more and longer videos from 'The Scary DBA', please!

Robert Schmehl on 10/16/2009
to short

Diana on 12/2/2009
Very comprehensive, very helpful. Thank you...

Eric on 11/16/2011
SQLShare is the best info site I have ever visited, and this video is a prime example why: no fluff, no all-encompassing definitions like a crash course, just a quick, to-the-point "cause and effect" type of explanation on a single piece of a single subject. My time of study/learned skill ratio is highest at SQLShare than any other, and videos like this are why.

Robin on 12/2/2011
Great little video. Keep 'em coming.

zishan qureshi on 12/2/2011
Many thanks. It would be good to know how that information would be useful in writing queries i.e. is there an alternative way of of writing this query to achieve the same result?

Rajiv Gupta on 12/2/2011
It is already repeated 1 million times.!!!

Paul on 12/2/2011
May have been good to compare union to union all (focusing on [sort distinct]).

John O'Sullivan on 12/2/2011
good video

SDAS on 12/4/2011
Please juxtapose this against a UNION ALL in a single video,showing data samples. You can also show how it performs as compared to a join in certain scenarios. Nice Video, keep up the good work.

Naveed Khawaja on 12/6/2011
Would definitely have benefited from having a comparison with the Union All operator, especially given how short the video was.

Margie on 12/7/2011
great teacher



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions