Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Updating stats and indexes

Author  Topic 

Bex
Aged Yak Warrior

580 Posts

Posted - 2009-02-25 : 07:08:07
You will have to excuse my ignorance on this topic.......

If you have a table who's data, once uploaded, is not changed in anyway (so data is uploaded, CREATE INDEXES, CREATE STATISTICS are run), then is there any need to create maintenance plans on that database?

If data is not inserted, deleted or updated, then no fragmentation will occur, and the stats will remain as is (if autoupdate is set of off)? Is this correct?

Say, perhaps, that some additional data is inserted. The PK is an auto increment IDENTITY field, therefore, additions will be appended to the end of the table. However, indexes reference other columns. At what point/threshold should I consider updating stats/rebuild indexes (for example, we have n rows, another x% of n are added.... what is the threshold of 'x'? (e.g. when the volume of data increases by 20%??)

Bascially, we have tables with millions of rows, and I want to avoid having to perform any maintenance if it is not required.

Thanks

Hearty head pats

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-25 : 07:53:26
quote:
Originally posted by Bex

You will have to excuse my ignorance on this topic.......

If you have a table who's data, once uploaded, is not changed in anyway (so data is uploaded, CREATE INDEXES, CREATE STATISTICS are run), then is there any need to create maintenance plans on that database?

If data is not inserted, deleted or updated, then no fragmentation will occur, and the stats will remain as is (if autoupdate is set of off)? Is this correct?

Say, perhaps, that some additional data is inserted. The PK is an auto increment IDENTITY field, therefore, additions will be appended to the end of the table.

You can guarantee that fragmentation won't occur in this case. It depends on Fill Factor and fragmentation level of pages.

However, indexes reference other columns. At what point/threshold should I consider updating stats/rebuild indexes (for example, we have n rows, another x% of n are added.... what is the threshold of 'x'? (e.g. when the volume of data increases by 20%??)

Read this:
http://support.microsoft.com/kb/195565

Bascially, we have tables with millions of rows, and I want to avoid having to perform any maintenance if it is not required.

Thanks

Hearty head pats

Go to Top of Page

Bex
Aged Yak Warrior

580 Posts

Posted - 2009-02-25 : 08:09:21
Thanks. I'll have a read of that article.

By the way, your sentence:

You can guarantee that fragmentation won't occur in this case. It depends on Fill Factor and fragmentation level of pages.

Did you mean to say 'can't' rather than can?

Hearty head pats
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-25 : 08:15:37
quote:
Originally posted by Bex

Thanks. I'll have a read of that article.

By the way, your sentence:

You can guarantee that fragmentation won't occur in this case. It depends on Fill Factor and fragmentation level of pages.

Did you mean to say 'can't' rather than can?

Hearty head pats



Yes you are right.
Go to Top of Page

Bex
Aged Yak Warrior

580 Posts

Posted - 2009-02-25 : 08:21:38
Ok, no probs. So just to clarify, fillfactor is the configurable amount of space left free on a page. What is fragmentation level?

Thanks

Hearty head pats
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-25 : 08:41:21
quote:
Originally posted by Bex

Ok, no probs. So just to clarify, fillfactor is the configurable amount of space left free on a page. What is fragmentation level?

Thanks

Hearty head pats



Please read Booksonline. It has all details
Go to Top of Page

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2009-02-25 : 14:17:43
quote:
Originally posted by Bex

You will have to excuse my ignorance on this topic.......

If you have a table who's data, once uploaded, is not changed in anyway (so data is uploaded, CREATE INDEXES, CREATE STATISTICS are run), then is there any need to create maintenance plans on that database?

If data is not inserted, deleted or updated, then no fragmentation will occur, and the stats will remain as is (if autoupdate is set of off)? Is this correct?

Say, perhaps, that some additional data is inserted. The PK is an auto increment IDENTITY field, therefore, additions will be appended to the end of the table. However, indexes reference other columns. At what point/threshold should I consider updating stats/rebuild indexes (for example, we have n rows, another x% of n are added.... what is the threshold of 'x'? (e.g. when the volume of data increases by 20%??)

Bascially, we have tables with millions of rows, and I want to avoid having to perform any maintenance if it is not required.

Thanks

Hearty head pats



You can use DMVs to filter out the used indexes and can then REORGANISE Or REBUILD as needed...As BOL says If fragmentation level is <= 30 then REORGANISE else REBUILD



Regards,
Ahmad Osama
Go to Top of Page
   

- Advertisement -