SQL 2005
--Script
Create table ATable
(
ID bigint identity(1,1)
,SomeColumn tinyint
)
Create clustered index Atable_ID_Clust
On ATable(ID)
Create nonclustered index ATable_Somecolumn
On Atable(SomeColumn)
/*Some more code and F5 and ATable has 480 mill rows*/
--Problem Statement
Update Atable
Set SomeColumn = 1
Where somecolumn = 0
Rowcount for Atable with SomeColumn = 0 is 477mill
Execution time 16 hours elapsed
I executed Select count(*) from ATable with (NOLOCK) where SomeColumn = 0
Results = 0
Investigations
Ok this was just the start. This now lead to many other investigations. Starting with the basics, locks? none, only user on machine, Server is paging? No perfmon shows
0.6 and 0.9 % of pagefiles used
SQL tells me that is is waiting for the disc subsystem WaitType = “PageIOLatch_EX” Again Perfmon comes handy. Check disc throughput 4 – 6 MB/sec.
This could not be possible. Ran SQLIO and pushed a 1GB file through to the drive with DBs on, Throughput 130MB/sec – 250MB/sec
If I create an exact duplicate of ATable and do insert into BTable (Select * from ATable) the throughput is 10 MB/sec to 30MB/sec
CPU’s Idle @ 9% (16 CPU’S), Drives with page files idleing at 1MB/sec if not 0, Memory cap 32 GB, SQL using 27GB
Only issue I found was memory page faults / Sec that are excessively high am unable to do memory test.
Any help PLEASE that does not include violence like kicking / shooting / throwing or formatting