Select to view content in your preferred language

Delete Rows GP Tool - Slow Performance in ArcGIS 10

4251
8
12-08-2010 03:17 PM
ChristopherMorneau
Emerging Contributor
Since upgrading to ArcGIS 10 (ArcInfo license level, SP1), I've experienced much slower performance with the Delete Rows GP tool (Data Management Tools > Tables > Delete Rows).

I run a process a few times per week that generates a table averaging approximately 100 rows.  For each table, I may need to do some post-processing & manually delete a handful of rows.  Yet, I don't want to open an edit session each time.  My solution has been to select the few rows I don't need, then run the Delete Rows tool, which deletes only the selections.  This worked lightning fast in 9.3.1, but takes upwards of a half minute or so in version 10.  That may not sound like much, but it's frustrating that something that worked so well in the last release is now bottle-necking my work flow.  Is this a flaw in the tool, or do I need to adjust something to improve the tool's performance?

Chris Morneau
Los Angeles County
Dept of Regional Planning
0 Kudos
8 Replies
ChrisSnyder
Honored Contributor
Can't verify that behavior in v10, but as a work around:

1. Copy the rows you want to keep to a new table
2. Use an update cursor (the .DeleteRow method) to delete the rows
0 Kudos
GaryBuell
Deactivated User
I have experienced the same behavior with Mosaic_to_New_Raster. It takes an inordinate amount of time to populate a toolbox form. Once that's been done, the process executes quickly. I'm running on a 64-bit W7 platform. However, it's not just that tool--I've had the same response with any of the tools.

Gary Buell
USGS
Atlanta, Georgia

Since upgrading to ArcGIS 10 (ArcInfo license level, SP1), I've experienced much slower performance with the Delete Rows GP tool (Data Management Tools > Tables > Delete Rows).

I run a process a few times per week that generates a table averaging approximately 100 rows.  For each table, I may need to do some post-processing & manually delete a handful of rows.  Yet, I don't want to open an edit session each time.  My solution has been to select the few rows I don't need, then run the Delete Rows tool, which deletes only the selections.  This worked lightning fast in 9.3.1, but takes upwards of a half minute or so in version 10.  That may not sound like much, but it's frustrating that something that worked so well in the last release is now bottle-necking my work flow.  Is this a flaw in the tool, or do I need to adjust something to improve the tool's performance?

Chris Morneau
Los Angeles County
Dept of Regional Planning
0 Kudos
ChristopherMorneau
Emerging Contributor
Can't verify that behavior in v10, but as a work around:

1. Copy the rows you want to keep to a new table
2. Use an update cursor (the .DeleteRow method) to delete the rows


Yes, I could do that (option 1), but why would I want to create a 2nd table?  Then I'd have to go back & delete the first table, then rename the 2nd to the original table name.  It's not a good work around if it creates more work.  I'd be better off just using the Delete Rows tool & wait the 30 seconds for it to run.

Maybe Option 2 is better, but now it's a moot point.  I enclosed the Delete Rows tool in a model & it takes about 1 second to run.  Now, that's a work around!

-Chris
0 Kudos
ChristopherMorneau
Emerging Contributor
Gary,

As I've indicated in my previous post today, try enclosing the Mosaic_to_New_Raster tool in a model (in ModelBuilder).  Setup your parameters as needed, then save & close it.  Then re-open it (click Open, not Edit) & run the model.

There's no guarantee that this will make your Mosaic_to_New_Raster process run faster, but it's worth a try.  This was my solution for the Delete Rows tool - it now performs lightning fast.

-Chris
0 Kudos
YingziYang
New Contributor
Hi Chris,
I had similar problem. When I ran Delete Rows from toolbox, it took 3 secs to delete more than 30000 rows but when I run it in a model which I built with Model Builder, sometimes it took half hour and sometimes 3 secs. The most recent 3 times I ran it fast, was with the shapefile added into TOC. I haven't tested enough but wish this might be helpful.
0 Kudos
ChristopherMorneau
Emerging Contributor

I haven't touched this thread in a while, so I don't know if others have discovered anything new during the interim.  I'm now using version 10.2.2, & Delete Rows is still slow when I use it as a stand-alone tool.

0 Kudos
MartinSchönfeld
New Contributor

Hi Chris,

I have made the same observation with ArcGIS 10.4.1. But also when I use the GP tool in ModelBuilder, there is no change in performance.

0 Kudos
ModyBuchbinder
Esri Regular Contributor

I have done some checks and I think I know the answer.

I think most people are using this command to truncate the layer (delete all records).

In 10.0 the GP would just delete row by row keeping the spatial index.

In 10.1 the GP delete the spatial index, delete the row and rebuild the index. If you delete all records it is much faster.

If you delete just a few records it takes time to rebuild the index for the remaining records.

That is what I found checking trace file of enterprise geodatabase, I this it is the same for FGDB. 

0 Kudos