Statistics - Never calculated on index

  • In taking a deeper look at the statistics on our 2008 instance, I have found several index and column statistics which have never been calculated. I looked in the sys.stats table using the STATS_DATE function. For a gross majority, there is a date there. I went under the object explorer to the Statistics branch under the object tree, went to the properties of the statistic in question and sure enough, at the bottom where it has: Statistics for these columns were last updated: it says (never). So, I click on the box to Update statistics for these columns and nope. Doesn't do it. I have run UPDATE STATISTICS with fullscan, sample, all ... nothing. The datatype for this one in particular is a UNIQUEIDENTIFIER (I know ... not my design), but dozens of other indexes are made of the same and they do have a date populated for them.

    Not much out there in the GoogleVerse on this, so I would appreciate any and all thoughts.

    Thanks

  • Is the table in question empty?

    Is the index_id possibly 0 (a heap)?

    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
  • Oy!!! I'm sooo embarassed. :blush: Yes, the tables are empty.

    Sometimes it is the most obvious things that get us.

    Thanks

    (Where's the delete thread button?)

  • If it makes you feel better, that exact scenario stumped me for more than a day a while back.

    No delete thread button, was removed after too many people deleted threads with huge amounts of info in after deciding they either had their answer or weren't going to get exactly the answer they wanted. Lots of people browse these boards without ever posting and learn from the existing threads.

    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
  • My deletion request was said tongue-in-cheek. :Whistling:

    Like you, I'm sure we won't be the last person to overlook this answer and it is good to have it out in the GoogleVerse.

    Thanks, Gail!

  • Well in my case the situation is different. The table is not empty. It is not a heap either. However clicking on "Update statistics for these columns" checkbox in SQL Management Studio has no effect whatsoever. Statistics are not updated after that even if I run the query, which needs them.

    Statistics still could be updated programatically without any problem. But I am simply curious why this checkbox in SSMS does not work? Any suggestions?...

  • How many rows are in the table?

    Can you run a trace and see what command is run after selecting the checkbox?

  • Davis H (10/11/2012)


    How many rows are in the table?

    Can you run a trace and see what command is run after selecting the checkbox?

    There are several thousands rows in the table.

    The SQL trace shows that no command at all is sent to the server after selecting the checkbox (which was expected knowing the outcome).

    I checked Microsoft forums and found that many people faced the same problem. And this is possibly a bug in SSMS.

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

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