Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Data distribution Expand / Collapse
Author
Message
Posted Tuesday, January 8, 2013 4:52 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 3:15 PM
Points: 299, Visits: 1,121
How can I find data distribution for a column?
Post #1404497
Posted Tuesday, January 8, 2013 5:19 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Saturday, October 18, 2014 4:43 AM
Points: 5,401, Visits: 7,512
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 Farrell

Never 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 Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1404502
Posted Wednesday, January 9, 2013 4:41 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 10:26 AM
Points: 13,884, Visits: 28,278
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 Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1404677
Posted Wednesday, January 9, 2013 7:50 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 3:15 PM
Points: 299, Visits: 1,121
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
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse