[GIS] Copying single selected polygon from large ArcSDE feature class in less than 10 seconds

arcgis-10.0arcpyenterprise-geodatabaseperformance

I have selected a single polygon, which is large but not massively complex, from an ArcSDE 9.3 for Oracle feature class with 3.5 million polygons using ArcGIS Desktop 10.0 SP3.

I would simply like to copy it out via ArcPy into a new shapefile (or file geodatabase feature class) and to do so in less than 10 seconds.

So far I have not been able to get it to happen in less than about 5-6 mins.

I think I need to try and take advantage of the processing environment (arcpy.env.extent) during the CopyFeatures, but if I set that to the values returned by getSelectedExtent and do the copy the time taken still seems to be 5-6 mins.

If instead I could get at a centroid x,y (and one that is guaranteed to fall inside the polygon) then I could use that to buffer a tiny amount and use that to set arcpy.env.extent and I would expect the time to come down to around 10 seconds.

However, to get at the centroid I think I still need to use CopyFeatures to get it out into a geometry first which seems Catch 22.

The 10 second target comes from Quickest way to select ArcSDE polygon by point in ArcGIS Desktop using ArcPy? which is another question based on the same dataset.

Best Answer

The solution to this question can be found as a comment to an ArcGIS Idea I posted when I concluded from discussion here that I really had hit a performance limitation that could only be addressed through an ArcGIS/ArcPy enhancement.

Fortunately, the Copy Features I was hoping to do in 10 seconds or less can be done in 4-5 seconds by downloading a script called Make Definition Query from a Selection to run prior to the Copy Features.

I am indebted to Chris Fox for pointing me at it.