Improve performance of Delete Rows Geoprocessing tool when source data is ArcOnline feature service

1612
9
07-14-2021 12:28 AM
LindsayRaabe_FPCWA
Regular Contributor

So with Pro 2.8, we got the much wanted improvements to the Append tool when appending features to a feature service in ArcOnline. This reduced upload times when appending hundreds or thousands of features from many, many mintutes/hours to mere seconds. 

It would be great if the same sort of improvement could be applied to the Delete Rows tool for when you're trying to do the opposite (still painfully slow). 

9 Comments
SarahAmbrose1

Truncate Table is a nice alternative that uses faster database commands to delete rows from the table.

https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/truncatetable.htm

But if you require the delete to only work against the selection, Truncate isn't the right tool as it cannot honor the selection. There is no way to undo or recover from the command which is how it can operate so fast compared to  row-by-row delete operations.

LindsayRaabe_FPCWA

Thanks for the suggestion @SarahAmbrose1 . I had not previously looked at this tool. Unfortunately, reading through the documentation at the link you provided, this doesn't look like it will work for this problem;

This tool does not support a feature service layer as input.

Though, I may start implementing it in other models that are modifying Feature Classes in place of the Delete Rows tool. I'll also test to see if it honours Definition Queries and Make Feature Layer for removing only a subset of rows in a table. 
RussellBrennan

Hi @LindsayRaabe_FPCWA 

At the next  (Autumn/Winter 2021) release of Pro the Truncate tool will be available to you when working with AGOL hosted services AND you are connected as a portal admin or service owner. 

We are also looking to make the improvements you request for deleting features/rows in upcoming releases but this likely will not make it into the software until the release after next (approx. Spring/Summer 2022 at the earliest).

As a sort of 'hack/workaround' you can use the button to enable undo on the Delete Rows tool. This should execute very quickly because it is first done on the client (Pro). When you then you click save, this is when we will send edits to the server. Doing it this way will result in fewer edit requests to the server which should speed up the deletion.

We have some doc on this delayed editing behavior here: https://pro.arcgis.com/en/pro-app/latest/help/data/services/edit-web-feature-layers.htm but you would sort of have to read between the lines to figure this out on your and how it might benefit in these sorts of situations.

Hope this helps.

Russell

LindsayRaabe_FPCWA

Hi @RussellBrennan. Thanks for the info - thats welcome news. The workaround you listed is also good to know, though won't help in most cases for me we're using this in Model Builder, so no Undo/Save option. The truncate tool though should do the trick when updated (I and my Team are admins so will work fine) - though unless you can confirm for me, I'll need to test to see if it honours Make Feature Layere to only delete a subset of rows and now the whole table???

I've already swapped Delete Rows out for the Truncate Table tool in some models where all rows are the target and it's a Feature Class, but the killers are those Feature Services, so looking forward to seeing that release. 

RussellBrennan
Status changed to: Under Consideration
 
RussellBrennan

@LindsayRaabe_FPCWA The Truncate tool operates at the data source level (geodatabase feature class or feature service layer) not at the layer level such as feature layers created in Pro maps or geoprocessing workflows. As such it will delete all rows not just a subset defined by a feature layer.

LindsayRaabe_FPCWA

@RussellBrennan Thanks for the extra info - saved me some trouble with testing. 

LindsayRaabe_FPCWA

@RussellBrennan 

Hi Russell. Just wondering if you have any updates on when we might see the improvements you mentioned above to the Truncate Table and Delete Rows tools?

LindsayRaabe_FPCWA

I've just done a quick review of the documentation for the Truncate Table tool and Delete Rows tool. Nothing has changed here so obviously didn't happen as part of the Autumn/Winter 2021 release of Pro (Truncate Table) or Spring/Summer 2022 release (Delete Rows). Hopefully just delayed and still on the way!