Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 Administration
»
Data distribution
Data distribution
Rate Topic
Display Mode
Topic Options
Author
Message
sunny.tjk
sunny.tjk
Posted Tuesday, January 08, 2013 4:52 PM
SSC Veteran
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 6:26 PM
Points: 263,
Visits: 866
How can I find data distribution for a column?
Post #1404497
Evil Kraig F
Evil Kraig F
Posted Tuesday, January 08, 2013 5:19 PM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 12:05 AM
Points: 5,688,
Visits: 6,142
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
Grant Fritchey
Grant Fritchey
Posted Wednesday, January 09, 2013 4:41 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 3:41 AM
Points: 13,383,
Visits: 25,189
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1404677
sunny.tjk
sunny.tjk
Posted Wednesday, January 09, 2013 7:50 AM
SSC Veteran
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 6:26 PM
Points: 263,
Visits: 866
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 »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.