I’ve got a big web-based reporting tool that has started to hit the ‘big time’ in terms of volumes of data. Now, performance issues are starting to crop up.
In particular, pages can load slowly and, at least once, INSERTS were timing out. After flailing around on this, I re-ran a clustered index on the PK of a main table and this sped things up. Today, the system started timing out again on pulling up some data on other tables. So…I re-can a clustered index on this table and… ta dah! it worketh. I went ahead and ran indexes on all the other tables just to feel better
Now, I’d like to just have SQL Server do this automatically. This may be a really simple problem to solve, but the UI is puzzling me. Triggers run SQL statements; I suppose you could put something like this is a SP:
CREATE UNIQUE CLUSTERED
INDEX [PK_Z_Counties] ON [dbo].[Z_Counties] ([County_Name])
WITH
DROP_EXISTING
ON [PRIMARY]
(this is on a ‘junk’ table as i don’t want to poke at production tables right now…)
But I’m again in flail mode
Anybody have anything to recommend here? Basically, I want SQL Server to re-run a clustered index on whatever, say, every two weeks. Perhaps this is a a SQL Server maintenance plan deal or somekind of Agent/Jobs task? It’s starting to look like triggers is not the way to go as they are tied to CRUD actions.
I’ll be looking around in the meantime, but any feedback on this would be appreciated. If you have any advise on Indexes or other things to offer re. why this might improve the performance of the db (and anything else that can help) I will definately appreciate it.
TIA