THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Michael Zilberstein

How do we know that Microsoft conducts performance tests?

We know it from comments in system procedure's code. Here is what I've found while digging for some undocumented stuff about statistics:

-- I don't like this copy&paste stuff, but here it boosts performance by 50%

You can find it too - in sys.sp_table_statistics2_rowset procedure. It returns first 2 parts of DBCC SHOW_STATISTICS result (stat header and density vector) in table format. The procedure header is:

EXEC sys.sp_table_statistics2_rowset
    @table_name = ?, --  sysname
    @table_schema = ?, --  sysname
    @table_catalog = ?, --  sysname
    @stat_name = ?, --  sysname
    @stat_schema = ?, --  sysname
    @stat_catalog = ? --  sysname

If you supply only @table_name and @stat_name, you'll receive the same output as from undocumented (I think) syntax of DBCC SHOW_STATISTICS:

DBCC SHOW_STATISTICS(@table_name, @stat_name) WITH STAT_HEADER JOIN DENSITY_VECTOR

Published Monday, March 24, 2008 11:31 AM by Michael Zilberstein

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(required) 
Submit
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement