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


SQL Index


SQL Index

Author
Message
snowfrost.c
snowfrost.c
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 18
Hi All ,
I am using MS SQL Server 2005 as my database. Previously I have some issues with my table indexes and the retrieval of my select is abit slow. If I drop and re-create the indexes, the select statement is fast.
Thus I have scheduled a job to drop and re-create my index weekly but it doesn't to work well. After 4 days, the select statement is slow again and I have to drop and re-create.
Anyone encountered this issue before and any solution is appreciated.

Thank You.
Sean Lange
Sean Lange
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: General Forum Members
Points: 64607 Visits: 17978
snowfrost.c (6/6/2014)
Hi All ,
I am using MS SQL Server 2005 as my database. Previously I have some issues with my table indexes and the retrieval of my select is abit slow. If I drop and re-create the indexes, the select statement is fast.
Thus I have scheduled a job to drop and re-create my index weekly but it doesn't to work well. After 4 days, the select statement is slow again and I have to drop and re-create.
Anyone encountered this issue before and any solution is appreciated.

Thank You.


You drop and recreate your indexes weekly??? Have you checked the fragmentation? You should read this article. http://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Modens splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Andrew Kernodle
Andrew Kernodle
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1370 Visits: 8135
Yep, definitely shouldn't be dropping and recreating the index each week. Using Ola's excellent maintenance plan to do REBUILD or REORGANIZE is definitely a better choice, and the root of the problem seems to be stale statistics, from a hazarded guess.

If the index is doing well after the creation and is degrading afterwards, the statistics are more than likely no longer good. Tossing in an UPDATE STATISTICS as needed should help to remedy that. From the sound of the problem, there's a good bit of data modification going on that needs to be accounted for.

- :-D
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