Solved

Issue With Date Index In SQL Server 2005

Posted on 2008-10-08
7
538 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 143

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error message when scheduling a job using a linked Server 12 67
Analysis of table use 7 54
CROSS APPLY 4 56
LAG_ROWID - how do I get the right order using this query? 2 15
In this article I will describe the Copy Database Wizard 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.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

789 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