Solved

Issue With Date Index In SQL Server 2005

Posted on 2008-10-08
7
537 Views
Last Modified: 2008-11-17
We have some ETL loads running to load data into a SQL Server table. This table has an index defined on a date columns

For reporting purpose we are using this table (in join with 13 other tables) to generate a report.

When ever some data is loaded into the table through ETL the indexes for that particular date are getting messed up and the query is just long running for that particular dates.

Once the indexes are rebuilt the query returns results in 7 seconds. Kindly suggest some permanent solution for this issue
0
Comment
Question by:jsrams
7 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 43 total points
ID: 22672450
you could drop the index before the ETL and add it again afterwards.
0
 
LVL 39

Assisted Solution

by:BrandonGalderisi
BrandonGalderisi earned 41 total points
ID: 22672470
Do you have a db maintenance plan that is reindexing your tables?  Any type of large data load (or purge) will not only fragment indexes, but will also mess with your statistics causing queries to run slow.
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 41 total points
ID: 22672472
if this ETL is loading lots of data, it might be considered to drop the index before and recreate it after the load.
0
 

Author Comment

by:jsrams
ID: 22672584
The data that is loaded through the ETL process is not more thatn 20000 records per day. Still is it preferred to rebuilt the indexes once the data load is done.
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22672620
>>Still is it preferred to rebuilt the indexes once the data load is done.

If they are fragmented.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question