Quantcast
Viewing all articles
Browse latest Browse all 3587

Re: Question about 'by Unpin'


Hi Anil,

 

The "Single Log Record" value looks like it might be reasonable.

I tested creating a single index on fairly small table on my test server and got about 600 flushes by SLR, so 6309 is believable if the table is larger or the sp_sysmon duration covered multiple index creates.

 

However, my test didn't get any flushes due to "Unpin". The documented explanation calls for there to be at least two processes trying to modify rows on the same page of a datarows table.  I tried a number of variations including partitioning the table, using datarows, specifying consumers, etc. and still got no Unpin flushes.

 

To investigate this a bit further, I recommend we tighten up the diagnostics a bit.  It would be good if the sp_sysmon only covered the creation of a single index.  We may also be able to find something interesting by looking at what monProcessActivity records for activity while the index is being created.  So do the drop and create index something like this (substitute in your own table and index details)

 

 

drop index <tablename>.<indexname>
go

drop table tempdb..activity_before
go
drop table tempdb..activity_after
go
select @@spid -- so we can easily identify ourself
go
select * into tempdb..activity_before from master..monProcessActivity 
go

-- In another session start sp_sysmon now
create index <indexname> on <tablename> ( <columnlist>)
go
select * into tempdb..activity_after from master..monProcessActivity
go

-- wait now for sp_sysmon to complete

 

select
a.SPID,
a.KPID,
a.ULCFlushes - b.ULCFlushes as "ULCFlushes",
a.ULCFlushFull - b.ULCFlushFull as "ULCFlushFull"
from 
tempdb..activity_before b,
tempdb..activity_after a
where
a.SPID = b.SPID

go

-- this is to show more about other spids active on the server

execute sp_who

go

-- this is to show how big the index is

execute sp_spaceused <yourtablename>, 1

go

 

My server gets these results for my small index:

 

  SPID        KPID        ULCFlushes  ULCFlushFull
----------- ----------- ----------- ------------
           2     1638413           0            0
           3     1769486           0            0
           4     1900559           0            0
           5     2031632           0            0
           6     2162705           0            0
           7     2293778           1            0
           8     2424851           0            0
           9     2555924           0            0
          10     2686997           0            0
          11     2818070           0            0
          12     2949143         578           32

(11 rows affected)

 

It won't be unusual to see the checkpoint process or housekeeper causing a few flushes.

 

Does your output show more than your own process doing a lot of flushes?

 

You might also eyeball the before and after data to see if there are any other columns with noticible changes in values that might give us clues.

 

-bret


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>