I'm using ArcGIS Pro 3.0.1 and I have a geoprocessing tool that creates some polyline features and appends them to a feature class that is stored in a SQL Server SDE database.
There are a large number of features already in the feature class, and I only append a small number of new features each time the tool is run. However, I'm noticing that the Append operation is taking a very long time to complete (a minute or more). It seems to be rebuilding the spatial index for the entire feature class each time the append is executed, which I don't want it to do. The problem is this tool is run frequently, and we can't afford the long wait time or performance hit while it rebuilds the spatial index.
In ArcMap this could be resolved by setting the Maintain Spatial Index environment setting on the Append tool to true/checked. And although that environment setting also exists in ArcGIS Pro (at a global level, not for the individual Append tool) it does not appear to be respecting it.
I found the following page saying that ArcGIS Pro doesn't honor this setting. I'm wondering, why?
Is there another way I can prevent the Append tool from causing the spatial index to be rebuilt?
You say "...this tool is run frequently...", but you don't say if you run the Append tool in a model or in a script?
Either way it seems this is a limitation of the Append tool you are experiencing. You could explore emulating the Append tool with an arcpy InsertCursor(). If you are running your working flow as a model then such python code could be run in a Calculate Value tool so you can use the rest of the model logic.
Sorry Duncan, I should have pointed out that this is a tool I built in ModelBuilder. Yesterday I published it as a geoprocessing task which will be called about every minute by a Windows Service that we developed.
When I started up my project this morning after a reboot last night, I checked all my settings and my environment setting for Maintain Spatial Index was unchecked! After checking it and saving, the append step runs in just a few seconds now, so maybe the documentation regarding this setting is not accurate after all? I'll do more testing today to see if this performance improvement is consistent.
I hadn't thought of using Calculate Value to run blocks of arcpy code - good idea! I haven't taken the plunge into writing these models using arcpy / Notebooks yet, but I think that's my next learning step. I like the graphical presentation of ModelBuilder to see the interconnections, but there seem to be some quirks with it that could be avoided by using pure scripting.
Thank you for your reply!