| Author |
Topic  |
|
|
Sean_B
Posting Yak Master
United Kingdom
111 Posts |
Posted - 02/04/2010 : 06:30:17
|
Hi,
when I do a select * into #temp from mytable I get a given number of reads on mytable.
However when I create the #temp table first and do an insert
insert into #temp select * from mytable.
I get the same number of reads on mytable, but also reads on #temp.
Why is it doing this and how can I avoid it, any suggestions appreciated.
Sean
Sean |
|
|
madhivanan
Premature Yak Congratulator
India
22460 Posts |
Posted - 02/04/2010 : 07:33:41
|
Your question is not very clear What do you mean by reads?
Madhivanan
Failing to plan is Planning to fail |
 |
|
|
Sean_B
Posting Yak Master
United Kingdom
111 Posts |
Posted - 02/04/2010 : 09:48:26
|
When I set the statistics on I get the following logical reads on the temp table
Table '#Temp2______________________________________________________________________________________________________________00000000A731'. Scan count 0, logical reads 294136, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Sean |
 |
|
|
madhivanan
Premature Yak Congratulator
India
22460 Posts |
Posted - 02/05/2010 : 01:04:44
|
quote: Originally posted by Sean_B
When I set the statistics on I get the following logical reads on the temp table
Table '#Temp2______________________________________________________________________________________________________________00000000A731'. Scan count 0, logical reads 294136, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Sean
Ok. What is your problem?
Madhivanan
Failing to plan is Planning to fail |
 |
|
|
Sean_B
Posting Yak Master
United Kingdom
111 Posts |
Posted - 02/05/2010 : 05:46:51
|
It is more of a question than a problem, why does the insert perform logical reads on the temp table it is inserting into, there are no keys or id columns on this table.
Sean |
 |
|
| |
Topic  |
|