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

STATISTICS in MS SQL Expand / Collapse
Author
Message
Posted Friday, November 20, 2009 11:12 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, December 26, 2012 11:03 PM
Points: 586, Visits: 2,195
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
Post #822845
Posted Saturday, November 21, 2009 2:29 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 2:44 PM
Points: 42,443, Visits: 35,498
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 2008, MVP
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

Post #822864
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse