Hello everyone,
I have a question.
---------------Script---------------------------------------
use AdventureWorks;
go
select * into test
from sales.SalesOrderDetail (nolock)
go
alter table test add primary key (SalesOrderDetailID)
-- SalesOrderDetailID int,identity,max:121317
go
set statistics io on
select MIN (SalesOrderDetailID) from test --logical reads:3
set statistics io off
go
delete from test where SalesOrderDetailID <= 121317
go
set statistics io on
select MIN (SalesOrderDetailID) from test --logical reads:2999
set statistics io off
-------------------------------------------------------------
So my questions are:
1:Why the two select querys logical IO differ so much?
2:Are index intermediate levels reflect the delete changes immediately, or after ghost-cleanup process finish deleted-records cleanup process?
please forgive me my poor english,thanks.