SPEED:  da.UpdateCursor vs. field calculation?

2746
3
12-28-2012 08:28 AM
KevinBell
Occasional Contributor III
I need to add 12 integers together for 1.5 billion points.  Would it be faster to do in a da.UpdateCursor or should I just use the standard field calculator?
Tags (2)
3 Replies
by Anonymous User
Not applicable
I would go with the update cursor (especially at 10.1).  In my experiences, update cursors are about waaaay faster than the field calculator or Calculate Field tool.  I used to have a script that would run 6 field calculations on a table with only 20,000 records that used to take about 15 minutes.  With update cursors (and dictionaries) the execution time is down to just under a minute.  You won't be able to use dictionaries with an update cursor on a table with 1.5 billion records, but I think using an update cursor by itself will definitely work much faster than field calculations.
0 Kudos
KevinBell
Occasional Contributor III
half a billion in one hour w/ da.updateCursor so far.  So 2 hrs to finish...  It took about 40 hrs w/ the field calculator.
0 Kudos
JamieKass
Occasional Contributor
Any input from ESRI folks on why this is true? I have had the same experiences where UpdateCursor is much faster than CalculateField, even when switching to 'VB', which is the recommended way to speed it up. What is CalculateField doing that slows it down? Shouldn't it simply run an UpdateCursor? Or is something else going on behind the scenes?
0 Kudos