Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Data distribution Rate Topic Display Mode Topic Options
Author
 Message
 Posted Tuesday, January 8, 2013 4:52 PM
 Old Hand Group: General Forum Members Last Login: Thursday, July 14, 2016 2:09 PM Points: 317, Visits: 1,344
 How can I find data distribution for a column?
Post #1404497
 Posted Tuesday, January 8, 2013 5:19 PM
 SSCertifiable Group: General Forum Members Last Login: Wednesday, September 23, 2015 3:34 PM Points: 5,467, Visits: 7,660
 What exactly are you looking for, the heuristics?I mean, straight data distribution could be done with a SELECT column, COUNT(*) AS cnt FROM table GROUP BY column.Can you be a little more specific as to what exactly you're trying to determine? - Craig FarrellNever stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake. For better assistance in answering your questions | Forum NetiquetteFor index/tuning help, follow these directions. |Tally TablesTwitter: @AnyWayDBA
Post #1404502
 Posted Wednesday, January 9, 2013 4:41 AM
 SSCoach Group: General Forum Members Last Login: Today @ 12:17 PM Points: 17,173, Visits: 32,139
 If the column has statistics on it, those represent the data distribution as SQL Server understands it. You can use DBCC SHOW_STATISTICS to see the density, also known as selectivity, and the histogram, which is the data distribution. If statistics don't exist for the column, you can just create them manually using CREATE STATISTICS. Then take a look at the distribution using SHOW_STATISTICS. ----------------------------------------------------"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore RooseveltThe Scary DBAAuthor of: SQL Server Query Performance Tuning and SQL Server Execution PlansProduct Evangelist for Red Gate Software
Post #1404677
 Posted Wednesday, January 9, 2013 7:50 AM
 Old Hand Group: General Forum Members Last Login: Thursday, July 14, 2016 2:09 PM Points: 317, Visits: 1,344
 Grant Fritchey (1/9/2013)If the column has statistics on it, those represent the data distribution as SQL Server understands it. You can use DBCC SHOW_STATISTICS to see the density, also known as selectivity, and the histogram, which is the data distribution. If statistics don't exist for the column, you can just create them manually using CREATE STATISTICS. Then take a look at the distribution using SHOW_STATISTICS.This is what I needed. Thanks a lot Grant.
Post #1404796

 Permissions