Search

Thursday, July 28, 2011

Nice code to investigate performance and bottlenecks

/*Gives information regarding density,pages etc in table form*/
DBCC SHOWCONTIG WITH TABLERESULTS, ALL_INDEXES

/*Gives information regarding density,pages etc in traditional form,Very valuable*/
DBCC SHOWCONTIG

/*defrags a given index on a given table, no locks*/
dbcc indexdefrag (TestDB,databases,pk_databases)

/*reindexes all indexes on a table, more efficient than indexdefrag but causes locks. */
dbcc dbreindex('databases')

/*Gives information regarding hit ratio etc. Very valuable*/
dbcc cachestats

/*Gives information regarding memory*/
dbcc memorystatus

/*Gives information regarding procedure cash, size etc.*/
dbcc proccache

No comments:

Post a Comment