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

Confio Ignite 8

What is the Distinct Operator?

You've probably used it, but do you know what goes on when you use the DISTINCT keyword? Or what a HASH MATCH aggregate is? Join SQL MVP Grant Fritchey for a quick two minute introduction to this great query plan operator.

Duration:
1 mins 22 secs
Skill Level:
100
Rating:
4.13 out of 5
Publish Date:
September 09, 2008
What is the Distinct Operator? 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
Venkata Taduri on 2/24/2009
Pretty informative. Thank you.

Jamshid Nouri on 6/25/2009
short and informative demo

Santosh Sharma on 6/25/2009
Though we know lot of operator this and other video gives us a better understanding of the concept and how they are executed in the background. Thank you Sir.

Lou Gallo on 6/25/2009
Sorry, in my mind, the description didn't match the title of this item. Interesting background though.

Grant Fritchey on 6/25/2009
Glad the video was helpful. These short videos seem to be pretty hit or miss.

Jed Perlowin on 6/25/2009
I was hoping he would compare it to the GROUP BY to see what the differences (if any) are.

Ivan on 6/25/2009
Thnks

datamama on 6/25/2009
nicely presented - BUT - a comparison to execution plan for a GROUP BY on the same data would have been quite useful

Carla Wilson on 6/25/2009
Ah, grasshopper! A good teacher shows the path but lets the student explore! Ok, so I set up a query using "group by" instead of "distinct", and I got the exact same query plan.

Carla Wilson on 6/25/2009
er, I should say, execution plan.

pundrick on 6/25/2009
Concise and complete

Grant Fritchey on 6/26/2009
I'm not sure who is the teacher and who is the student in this situation. ;-) That is interesting that it showed an identical execution plan. What I hoped was the key take-away here is that the DISTINCT operation is an aggregation and therefor, usually expensive.

Girish kalwadia on 6/28/2009
Its realy good and helpfull. Thanks for that

325BD96788 on 7/6/2009
Simple but good...

325BD96788 on 7/6/2009
Simple but good...

Hansjörg on 7/8/2009
but what if no index covers the columns in the distinct list?

Caleb Bell on 7/16/2009
Is there a way to optimize usage of the DISTINCT operator (i.e. is there a way to minimize the cost of the Hash Match (Aggregate) function)?

Grant Fritchey on 7/17/2009
Since it's an aggregation, it really depends on what you're aggregating. If you have a covering index you could see some performance improvement. But in general, aggregation is expensive and frequently involves extra operations such as the Hash Match in order to arrive at the unique list of data.

marcor on 8/13/2009
It's excellent. Thanks.

Stephanie Brown on 6/17/2011
learned something new - always good!

Russell Tye on 11/22/2011
you didn't even finish the presentation!!!

Skip Sailors on 11/22/2011
The explanation of what a hash is (it's matehematical basis), and how it is used is weak, IMO, and would leave uninitiated confused. If we are not going to explain a hash, give a citation for people who want more information.

Rajiv on 11/22/2011
good one

Charlie Bruno on 11/22/2011
Very good explanation and very informative.

Lisa Rentmeester on 11/22/2011
it ended almost as soon as it started.

Jack Pines on 11/22/2011
I hope that there is a follow up on techniques to speed up or eliminate the distinct.

Nicola Pennimpede on 11/22/2011
author should have indicated how to avoid the high cost of using distinct

Michael Sidley on 11/22/2011
I would like more info on effective ways of using it less on the execution plan and what it is doing in the backround.

John on 11/22/2011
The video had good information, but I was hoping that it would go into a little bit more detail about the hashing. It was all just a little too quick. I know that that is pretty valued here, but I wish that this had taken some more time and given some more detail. The author is obviously knowledgeable enough to provide the detail.

Raman on 11/23/2011
Must have some text detail about distinct

Robert on 11/28/2011
The video was cut short.



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