Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

Please include schema / database prefix in STATISTICS IO output

STATISTICS IO output only specifies table name - if you have identical tables from different schemas or in different databases, it is impossible to determine which is which. Can we please add both prefixes?

Here is an example. Set up this set of tables:

USE tempdb;
GO
CREATE SCHEMA flack;
GO
SELECT * INTO flack.t1 FROM sys.all_objects;
GO
SELECT o.* INTO msdb.dbo.t1 FROM sys.all_columns AS c
CROSS JOIN (SELECT TOP (100) * FROM sys.all_objects) AS o;
GO

Now run this query:

SET NOCOUNT ON;
SET STATISTICS IO ON;
GO
SELECT * FROM tempdb.flack.t1
UNION ALL
SELECT TOP (10000) * FROM msdb.dbo.t1;
GO
SET STATISTICS IO OFF;

The output is:

Table 't1'. Scan count 1, logical reads 219, physical reads 145, read-ahead reads 431, ...
Table 't1'. Scan count 1, logical reads 38, physical reads 0, read-ahead reads 38, ...

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    AdminMicrosoft SQL Server (Admin, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base