Author |
Topic |
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2012-04-20 : 13:59:11
|
I am using temp table to process the tasks.Does the temp tables will have performance issue..It is very slow..Ex: Select * into temp_test from testPlease suggest to resolve the performance issue.. |
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2012-04-20 : 14:38:26
|
Do not use a temp table. Use set-based logic instead of a cursor. Look both ways before you cross the road.How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2012-04-20 : 14:44:25
|
Eat your veggies. Brush your teeth.Your question is too vague to answer, and not even worded correctly. First, "temp_test" is not a temp table, it's a regular table. Second, how many rows are you selecting from test, and do you really need all of them? |
 |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2012-04-20 : 15:42:32
|
Thanks for the response..There was typo..Select * into #temp_test from testsecondly There nearly 10 million rows select from test table.. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-04-20 : 15:44:04
|
do you have proper indexes created. Also are you sure you really want to work with all the 10 million rows?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2012-04-20 : 16:13:47
|
yes the process used all 10 millions rows as there is no index defined.I will add an index to the temp table. |
 |
|
Sachin.Nand
2937 Posts |
Posted - 2012-04-21 : 04:08:07
|
Do you have the hardware that support's the process on your 10 million rows ?After Monday and Tuesday even the calendar says W T F .... |
 |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2012-04-21 : 09:42:56
|
Yes |
 |
|
Sachin.Nand
2937 Posts |
Posted - 2012-04-21 : 09:54:03
|
quote: Originally posted by sqlfresher2k7 Yes
So whats the configuration ? Is tempdb optimised ? Do you observered any page allocation contentions on tempdb ?After Monday and Tuesday even the calendar says W T F .... |
 |
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2012-04-23 : 06:42:59
|
I think the correct question has STILL not been asked. WHAT are you doing? Why do you think you need a 10 million row temp table?The HOW TO ASK link should help you answer OUR question.How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|