Select to view content in your preferred language

Very slow Append - how to clear out GDB_ITEMS Doumentation xml field?

873
2
Jump to solution
09-18-2023 06:38 AM
DonMorrison1
Frequent Contributor

I have a script that runs every 10 minutes and appends on the average handful of records to an SDE point feature class each time.  I noticed that is has been taking almost 3 minutes to do the append which seems unreasonable for 4 or 5 records.  I converted the Append to InsertCursor and it how takes about 1 second. But the Append is much simpler and I'd like to get to the bottom of the problem.  I've tried suggestions from other posts to no avail:

  1. Rebuild the spatial index
  2. arcpy.SetLogHistory(False)
  3. arcpy.SetLogMetadata(False)

I checked the "Documentation" field in the GDB_Items table and see the the xml contents is 82Meg so maybe that really is the problem - where it has to get read in and updated on every Append (even when I thought I turned of metadata and history logging).  Does anybody know the best way to clear out the "Documentation" field (can I just set it to an empty string?) and what is the downside of doing this?

I'm using SQL Server and ArcGIS Pro 3.1.1 (Windows)

0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi @DonMorrison1 ,

Try deleting the GP History from the geodatabase to see if that improves performance:

https://support.esri.com/en-us/knowledge-base/how-to-delete-geoprocessing-history-from-a-geodatabase...

I did find one issue with the script when running with ArcGIS Pro 3.1.  I had to remove db, from the below line:

JakeSkinner_0-1695045161487.png

 

View solution in original post

2 Replies
JakeSkinner
Esri Esteemed Contributor

Hi @DonMorrison1 ,

Try deleting the GP History from the geodatabase to see if that improves performance:

https://support.esri.com/en-us/knowledge-base/how-to-delete-geoprocessing-history-from-a-geodatabase...

I did find one issue with the script when running with ArcGIS Pro 3.1.  I had to remove db, from the below line:

JakeSkinner_0-1695045161487.png

 

DonMorrison1
Frequent Contributor

That did the trick - exactly what I was looking for. The append that previously ran almost three minutes now takes about 1 second.  The script ran as-is (except for editing in my workspace path).  It did take an exception for one feature class when removing the metadata but that feature class was of no importance so I just put a handler around it to keep the script running

        try:
            tgt_item_md.save()
        except Exception as ex:
            print (str(ex))

Thanks @JakeSkinner !

0 Kudos