Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Simple Index question Expand / Collapse
Author
Message
Posted Friday, August 30, 2013 7:38 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 6:30 AM
Points: 22, Visits: 64
Good Morning All,

Just a quick question...

I have a table which updates on a daily basis after 11pm when no-one is here.

Is it good practise to have the indexes build each day or each week?

Each update adds approximately 10000 rows of data

Thanks in advance
Post #1490157
Posted Friday, August 30, 2013 9:41 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Thursday, June 26, 2014 4:08 AM
Points: 708, Visits: 3,286
waxb18 (8/30/2013)
Good Morning All,

Just a quick question...

I have a table which updates on a daily basis after 11pm when no-one is here.

Is it good practise to have the indexes build each day or each week?

Each update adds approximately 10000 rows of data

Thanks in advance


I don't think this has much to do with best practice. It depends on your maintenance window and the size of the table. If it's going to take a few minutes to rebuild the index then just do that every night.


---------------------------------------------------------


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
Post #1490211
Posted Friday, August 30, 2013 4:01 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Yesterday @ 2:28 PM
Points: 786, Visits: 691
It's impossible to say. In the system I work there is a table to which a bunch of rows are added every night. This job usually completes in a few minutes. But after index rebuilds it runs for an hour.

Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Post #1490325
Posted Friday, August 30, 2013 4:32 PM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 1:27 PM
Points: 5,974, Visits: 12,875
hard to say on index rebuilds, check the fragmentation daily to see how quickly the indexes fragment.

You may want to update your stats after the upload though. Presuming you have auto update stats turned on for a table larger than 500 rows stats will only update automatically when (from BOL):

'The table had more than 500 rows when the statistics were gathered, and the colmodctr of the leading column of the statistics object has changed by more than 500 + 20% of the number of rows in the table when the statistics were gathered.'

If 10000 rows is not enough to trigger that your stats could be less than optimum.


---------------------------------------------------------------------

Post #1490332
Posted Saturday, August 31, 2013 11:50 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, July 7, 2014 1:12 AM
Points: 43, Visits: 182
You should keep an eye on the fragmentation of the index every day.
If you notice the fragmentation growing to high ( > 30% ) you should consider rebuilding the index every n days depending on how many days it took for the fragmentation to reach 30%.

There is no need to update statistics after you have rebuild your index, this happens with the rebuild action.
Post #1490438
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse