Arcpy 'Append_management' much slower than ArcMap Tool?

417
2
07-19-2019 12:58 PM
JosephKlasnic
New Contributor

I have data in a file geodatabase feature class that I am appending to a feature class in an enterprise geodatabase.

This is the code:

(assume variables are assigned and existing. Arcpy and Time are imported)

start_time = time.clock()
arcpy.Append_management(local_fc_path, sde_fc_path, "NO_TEST")
elapsed_time = (time.clock() - start_time)
print "Append Took {}".format(elapsed_time)

This takes 1105.675 seconds (over 18 minutes) for 138 features. In practice, no matter how many rows are in the source table, it takes about this much time.

Running the append in the Python interpreter in ArcMap 10.2.1 for the same 138 features takes .94 seconds

When doing the same thing in ArcMap 10.2.1 using the Append tool from the Data Management toolbox, with the same parameters and same 138 features, it takes 1.03 seconds.

Is there any explanation for this?

Tags (2)
0 Kudos
2 Replies
JoeBorgione
MVP Esteemed Contributor

When you run the tool it's from and to the same source and target?  That does seem odd to take 18 minutes for less than 150 records. Using version 10.2 is running on borrowed time; you really should consider upgrading.

That should just about do it....
0 Kudos
JosephKlasnic
New Contributor

Hi. Yes it is the same exact source and target. And I understand that 10.2.1 is old and we have plans to upgrade, but for the time being need to run this using 10.2.1. I can also find other instances (using different feature classes but the same SDE conection to the same enterprise geodatabase) that do not take this long.

0 Kudos