|
----------------test1,guid----------------
select guid_row into #A2
from test_delete2 with(nolock) ----1000w,guid_row ,pk and clustered index
where rowid%100 = 0
--1075
create clustered index inx2 on #A2(guid_row)
select top 100 * into #T2 from #A2
set statistics io on
delete s
from test_delete2 s
inner join #T2 t on s.guid_row = t.guid_row
Table 'test_delete2'. Scan count 100, logical reads 1262, physical reads 3, read-ahead reads 64, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table '#T2_________________________________________________________________________________________________________________00000000002A'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
(100 row(s) affected)
---------------------test2 int -----------------------------------------------
select rowid into #A1
from test_delete1 with(nolock) ----1000w, rowid int ,pk and clustered index
where rowid%100 = 0
--1075
---create index on A1
create clustered index inx2 on #A1(rowid)
------------------
select top 100 * into #T1 from #A1
--------------
set statistics io on
delete s
from test_delete1 s
inner join #T1 t on s.rowid = t.rowid
Table 'test_delete1'. Scan count 100, logical reads 869, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table '#T1_________________________________________________________________________________________________________________000000000029'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
(100 row(s) affected)
|
|