Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


STATISTICS in MS SQL


STATISTICS in MS SQL

Author
Message
parthi-1705
parthi-1705
SSChasing Mays
SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)SSChasing Mays (602 reputation)

Group: General Forum Members
Points: 602 Visits: 2196
Hi

What is STATISTICS in MS SQL ?
What is CREATE STATISTICS?
what is UPDATE STATISTICS?
DBCC SHOW_STATISTICS ?
SP_updatestats

With this how we can optimize our query or time consumption
SET STATISTICS PROFILE { ON | OFF }?
SET STATISTICS IO { ON | OFF }?
SET STATISTICS TIME { ON | OFF }?

pls help me in this.

Thanks

Thanks
Parthi
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47281 Visits: 44392
Firstly, statistics as controlled by Create/update/drop/ DBCC SHOW_STATISTICS are completely unrelated to SET STATISTICS XX. The first are column statistics used by the optimiser, the second shows query execution statistics.

Some links (that you could easily have found with Google)
CREATE STATISTICS - http://msdn.microsoft.com/en-us/library/ms188038%28SQL.90%29.aspx
UPDATE STATISTICS - http://msdn.microsoft.com/en-us/library/ms187348%28SQL.90%29.aspx
sp_updatestats - http://msdn.microsoft.com/en-us/library/ms173804%28SQL.90%29.aspx
DBCC SHOW_STATISTICS - http://msdn.microsoft.com/en-us/library/ms174384%28SQL.90%29.aspx

SET STATISTICS XX -
http://msdn.microsoft.com/en-us/library/ms190287%28SQL.90%29.aspx
http://msdn.microsoft.com/en-us/library/ms184361%28SQL.90%29.aspx

Finally, there's a whitepaper on how SQL uses statistics. Long, fairly deep but good - http://technet.microsoft.com/en-us/library/cc966419.aspx and I did a presentation on Statistics at the SQL PASS Summit couple weeks back. The deck's up on my blog. http://sqlinthewild.co.za/index.php/resources/

If you still have questions after reading through all that, some back and ask.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search