Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Objects are without statistics!!!


Objects are without statistics!!!

Author
Message
JMSM
JMSM
SSC-Enthusiastic
SSC-Enthusiastic (190 reputation)SSC-Enthusiastic (190 reputation)SSC-Enthusiastic (190 reputation)SSC-Enthusiastic (190 reputation)SSC-Enthusiastic (190 reputation)SSC-Enthusiastic (190 reputation)SSC-Enthusiastic (190 reputation)SSC-Enthusiastic (190 reputation)

Group: General Forum Members
Points: 190 Visits: 965
Hello,

We've got a client that detect that in one database three tables are without statistics.

Q1: My SQL Instance its configured to automatically update statistics so why are not update statistics on those objects?

Q2: How can the client detect that statistics were not updated?

Q3: What is the best way to configure or not configure statistics in an object?

Q4: Whar is the impact on create statistics during daily working hours?

Table [TableName1] on column [column1]
Table [TableName2] on column [column2]
Table [TableName3] on column [column3]

Thanks and regards,
JMSM Smile
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47239 Visits: 44376
JMSM (1/21/2010)

We've got a client that detect that in one database three tables are without statistics.

Q1: My SQL Instance its configured to automatically update statistics so why are not update statistics on those objects?


Auto_update only updates existing statistics, it won't create new ones. For that, auto_create has statistics to be enabled and SQL has to need the statistics. If it doesn't need them, it won't create them.

Q3: What is the best way to configure or not configure statistics in an object?


Let SQL create them (auto create), let SQL automatically update them unless you know that the auto_update is not sufficient.

Q4: Whar is the impact on create statistics during daily working hours?

Table [TableName1] on column [column1]
Table [TableName2] on column [column2]
Table [TableName3] on column [column3]


Minimal, but only create them if you're sure they're needed. If auto_create statistics is on, SQL will automatically create any it needs and you don't have to bother.


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


bitbucket-25253
bitbucket-25253
SSCertifiable
SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)

Group: General Forum Members
Points: 5689 Visits: 25280
In additiion to GilaMonster's comments, and the database is configured as decribed.
Do the two tables in question have any indexes? If so statistics will be automatically created for them. If auto created statistics exist their name will start with "_WA_"

If you desire to check the auto_create and auto_update statistics setting execute:
SELECT is_auto_create_stats_on,  is_auto_update_stats_on
FROM sys.databases WHERE Name = 'xx''--replace the xx with the name of the database
If these are set to ON then a value of 1 will be returned for each item



Does your user have SSMS?
If yes then have them select each table and then select statistics -- if stats exist their names will be shown.
To learn when the stats have been last updated double click on the statistics name, then in the drop down double click on "Properties" , in the next window select "Details" (single click) - this will display the last time the stats were updated and further information - a lot of information.

SQL in general attempts to create statistics even for the simpliest of tables and queries. For example:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[NonExisting](
[ABC] [varchar](10) NULL
) ON [PRIMARY]
GO
INSERT INTO dbo.NonExisting
SELECT 'BBB' UNION ALL
SELECT 'ouch' UNION ALL
SELECT 'mymy'
-- now execute
SELECT ABC FROM dbo.NonExisting


Check and you will see that a statistic was created on my machine it was named "-WA_sys-00000001_18EBB532"

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
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