SQLTeam.com | Weblogs | Forums

Optimize Table


#1

Hi team

I have table which contains million rows and 500 columns and while inserting 30 lakh data in to another table.it is taking time an 1 hour.Please share the optimising process.Clustered index already created on date column.PLease fin my query

insert into select * From table 1 where eventdate>='2015-11-02'


#2

drop all non-clustered indexes before insert, then rebuild them after insert. Also, are all the new dates > all the current dates in the table?


#3

Hi

Thanks for the suggestion.But i am using the CTE now.it is taking less time.


#4

that makes no sense at all. A CTE isn't a performance tool; it's just an easy way to define subqueries. Unless you've changed the way the resulting query is done (check the execution plan) the performance (and the plan) would be identical.