Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Enable disable indexes

Author  Topic 

ishti123
Starting Member

5 Posts

Posted - 2011-03-10 : 06:03:11
i have table with thousands of rows and 7 nonclustered indexes.
insertion in the databse is only once in a day,
we insert almost 3 to 8 thousand records everday at a specific time.and delete almost
the same number of old records.
insertion takes a 3 to 4 hours, i want to make the insertion process
faster by disabling the indexes temprarily, and after insertion
enable and rebuild the indexes again.
is it a good approach?

subhbwn
Starting Member

6 Posts

Posted - 2011-03-10 : 07:56:17
Before you begin drop index, insert records and then create the index again.
You can visit http://www.w3resource.com/sql/drop/drop-index.php, http://www.w3resource.com/sql/creating-index/sql-creating-index.php, http://www.w3resource.com/sql/insert-statement/sql-insert-command.php
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-03-10 : 08:00:35
How do you do the insertion ?

PBUH

Go to Top of Page

ishti123
Starting Member

5 Posts

Posted - 2011-03-10 : 08:34:03
we scrap some data from web and insert it into our DB.
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2011-03-10 : 09:26:39
insertion takes a 3 to 4 hours??? for <8000 records.

your problem is unlikely to be SQL (indices or not)...unless you are using "CURSOR"s

what are you running on - a 1950's calculator?
Can you post your code & DDL?
Go to Top of Page
   

- Advertisement -