SELECT StatMan

  • Does anyone know what the query below means? I'm running into this type of query pretty frequently an I'm not sure how to find out the problem, if there's any.

    SELECT StatMan([SC0])

    FROM

    (

    SELECT TOP 100 PERCENT [AT_field_3] AS [SC0]

    FROM [dbo].[tablename]

    WITH

    (

    READUNCOMMITTED

    )

    ORDER BY [SC0]

    ) AS _MS_UPDSTATS_TBL

    Thanks.

  • It's a statistics update, probably auto-stats.

    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
  • I have a job running statistics, that's generating it?

    use [DatabaseName]

    GO

    UPDATE STATISTICS [dbo].[tablename]

    WITH FULLSCAN

    GO

    Do you know why is selecting some tables and not others?

  • The cause for it to not select some tables is likely due to how your code is written.

    Please provide the entire code that is generating your update stats so we can help you identify what is happening.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • HildaJ (7/26/2013)


    I have a job running statistics, that's generating it?

    Either that or the automatic stats updates, or both.

    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
  • This is all that the sql monitor tool throws out to the log:

    SELECT StatMan([SC0])

    FROM

    (

    SELECT TOP 100 PERCENT [AT_field_3] AS [SC0]

    FROM [dbo].[tablename]

    WITH

    (

    READUNCOMMITTED

    )

    ORDER BY [SC0]

    ) AS _MS_UPDSTATS_TBL

    It seems to dump this log when I ran the maintance plan to update the stats. My maintenace plans has this:

    use [DatabaseName]

    GO

    UPDATE STATISTICS [dbo].[tablename]

    WITH FULLSCAN

    GO

  • The Statman query is what's run internally for statistics updates.

    What exactly is the problem here?

    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
  • I'm not sure if there's a problem, I have not seen this query before and I was inquiring information about it. I see now that updating statistics generates these queries. It seems that this is normal operation on part of sql server.

  • HildaJ (7/26/2013)


    I'm not sure if there's a problem, I have not seen this query before and I was inquiring information about it. I see now that updating statistics generates these queries. It seems that this is normal operation on part of sql server.

    Yes it is

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply