May 22, 2012 at 3:23 am
Dear Friends,
I have a table having 8 to 10 crore data in this table and i want to transfer top 1000 rows into another table
for this i use following query to accomplish this task:
select TOP 1000 * into WealthMaker_MF.Transaction_ST_TMP from wealthmaker_mf.transaction_st
but query running from last 1 hour yet not completed .
Please send me some other suggessions to accomplish this task..or tell me how to speed up this task
Thanks!!
May 22, 2012 at 3:43 am
Please post source and destination table structures
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
May 22, 2012 at 3:48 am
select TOP 1000 * into WealthMaker_MF.Transaction_ST_TMP from wealthmaker_mf.transaction_st
but query running from last 1 hour yet not completed .
It looks like that you want to insert just 1000 rows ( even though table has around 80-100 million rows) and thus it should not take like 1 hour.Two possible issues I could see.
1. Either someone is blocking you. This you can see using sp_who or sp_who2 or using dmv's or sysprocesses.
2. Or you have some order by in you select statement. Is that complete sql statement?Are you using any kind of order by in the statement? If there is some order by then it might be possible that sorting 80-100 million rows might take time. Thus make sure that you do not have order by on that select statement.
If you do not have none of aboev. Then post the full statement along with estimated execution plan.
GulliMeel
Finding top n Worst Performing queries[/url]
Improve the performance of Merge Join(special case)
How to Post Performance Problem -Gail Shaw[/url]
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply