SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Problem with statistics


Problem with statistics

Author
Message
Matt-1034261
Matt-1034261
SSC-Enthusiastic
SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)

Group: General Forum Members
Points: 133 Visits: 305
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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87109 Visits: 45267
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


Matt-1034261
Matt-1034261
SSC-Enthusiastic
SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)

Group: General Forum Members
Points: 133 Visits: 305
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
Matt-1034261
Matt-1034261
SSC-Enthusiastic
SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)

Group: General Forum Members
Points: 133 Visits: 305
I just checked the database properties and it looks like auto create stats is set to false
Matt-1034261
Matt-1034261
SSC-Enthusiastic
SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)

Group: General Forum Members
Points: 133 Visits: 305
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search