unknown
2009-12-16 14:14:46 UTC
Hi I am doing a simple test,
Updating all rows in tbl1 which has 1 million rows.
1) When no index
Table: tbl1 scan count 1, logical reads: (regular=18001
apf=0 total=18001), physical reads: (regular=8 apf=9028
total=9036), apf IOs used=9028
Total writes for this command: 15543
Execution Time 58.
Adaptive Server cpu time: 5800 ms. Adaptive Server elapsed
time: 32043 ms.
(1000000 rows affected)
<<
2) When 1 index on col1
Table: tbl1 scan count 1, logical reads: (regular=18001
apf=0 total=18001), physical reads: (regular=8 apf=9028
total=9036), apf IOs used=9028
Total writes for this command: 20214
Execution Time 53.
Adaptive Server cpu time: 5300 ms. Adaptive Server elapsed
time: 30400 ms.
(1000000 rows affected)
I see the difference in "Total writes for this command:".
When there is an index and if the index column is being
changed then I can understand there would be additional
writes, but in my case I am not updating the index column,
why there are additional writes when updating non index
columns!
Updating all rows in tbl1 which has 1 million rows.
1) When no index
Table: tbl1 scan count 1, logical reads: (regular=18001
apf=0 total=18001), physical reads: (regular=8 apf=9028
total=9036), apf IOs used=9028
Total writes for this command: 15543
Execution Time 58.
Adaptive Server cpu time: 5800 ms. Adaptive Server elapsed
time: 32043 ms.
(1000000 rows affected)
<<
2) When 1 index on col1
Table: tbl1 scan count 1, logical reads: (regular=18001
apf=0 total=18001), physical reads: (regular=8 apf=9028
total=9036), apf IOs used=9028
Total writes for this command: 20214
Execution Time 53.
Adaptive Server cpu time: 5300 ms. Adaptive Server elapsed
time: 30400 ms.
(1000000 rows affected)
I see the difference in "Total writes for this command:".
When there is an index and if the index column is being
changed then I can understand there would be additional
writes, but in my case I am not updating the index column,
why there are additional writes when updating non index
columns!