When is it okay to DROP STATISTICS?

  • I'm a relatively new DBA, so I'm sorry if this is a dumb question.

    I am working with a VLDB (approaching 1.5 TB) and I have to update statistics regularly b/c of the high DML on certain tables. I have many indexes created and corresponding statistics, but when I view some of the system-created statistics, they show no data for HISTOGRAM VIEW. Some of them indicate that they've never been updated, and when I do it through code or through the GUI, it does not change.

    "Best practices" articles say to leave system-created stats alone, but I am just curious: is it safe to drop these? And, how can I know for sure to safely drop any of the others that, though they are "updateable," show no values in them?

    Thanks much for any advice.

    Membrane.Inside("Insane");

  • You can drop them any time. If you have auto_create_statistics set to true (database-level option) then if they are needed, they'll be recreated. That said, on larger tables creating stats may take a couple seconds and so if a query needs them, that query will have to wait while the stats are recreated.

    Are they based off of empty tables? That's the usual reason that the histogram will be empty.

    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

Viewing 2 posts - 1 through 1 (of 1 total)

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