Problem with statistics

  • Hi

    I have noticed that looking at the execution plan of one of our sql queries there is a little yellow triangle telling me that some of the columns do not have statistics.

    I updated the statistics containing the columns that were being complained about and yet the yellow traingle warning sign still continues to appear :crying:

    Do I need to do something else?

    Thanks

    Matt

  • The warning triangle is saying there are statistics missing. Update stats only updates existing stats, it won't add new ones.

    Is auto_create_stats on? What's the object that the warning is on?

    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
  • GilaMonster (2/16/2011)


    The warning triangle is saying there are statistics missing. Update stats only updates existing stats, it won't add new ones.

    If I expand the statistics node on the table that has the problem columns there is a statistic in there that contains the colums that are supposedly missing. I clicked on the 'update statistics for these colums' checkbox hoping that it would clear the error.

    GilaMonster (2/16/2011)


    Is auto_create_stats on?

    Not sure, how would I check that?

    GilaMonster (2/16/2011)


    What's the object that the warning is on?

    It appears to be an index that is on the table

  • I just checked the database properties and it looks like auto create stats is set to false

  • I just used this: -

    USE <database name>;

    GO

    ALTER DATABASE <database name>

    SET AUTO_CREATE_STATISTICS ON;

    ALTER DATABASE <database name>

    SET AUTO_UPDATE_STATISTICS ON;

    GO

    and it seems to fix the problem as the warning sign is gone now

Viewing 5 posts - 1 through 4 (of 4 total)

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