6

I'm using ArcMap and I'm trying to write a script that automates a join and then does some reporting.

I'm not very experienced with joins and I'm running into a problem. When I do a join manually (right clicking the shapefile and specifying the join) it does the join seemingly automatically. However, when I try and do a "Join Field" in ModelBuilder it takes a really long time. Minutes.

Is there a different method of automating a join using python or Model Builder that runs faster?

3 Answers 3

9

If you look at the tool help you'll note that Join Field permanently adds 1 or more fields to the input table.

The tool you probably want is Add Join, which works more like the interactive join command to create a temporary join.

You'll probably want to use Remove Join when you're done though to clean up after yourself.

3

In addition to blah238's answer, you should also use the Add Attribute Index geoprocessing tool to create an index for the join. This tool accomplishes the same thing as this prompt:

enter image description here

This will greatly increase performance. Note that some read-only table file types (e.g. CSV) don't support attribute indices, so you'll have to export them to a .dbf file first.

1
  • creating an index for the join field in the join table sounds a good idea, but would it also be advised to create an index on the join field of the target layer? @dmahr
    – Theo F
    Commented Nov 14, 2017 at 17:16
2

This has been reported to the ArcGIS Ideas forum here: https://geonet.esri.com/ideas/8679

A python script to automate joining the fast way has been provided here: http://www.arcgis.com/home/item.html?id=da1540fb59d84b7cb02627856f65a98d

2
  • should be noted this script only works with GDB inputs
    – NULL.Dude
    Commented May 10, 2017 at 12:57
  • I struggled with awesome slow JoinField in my script. The link to the python script is worth a lot. Following the instructions there I reduced overall calculation time to 1/7.
    – EikeMike
    Commented Jan 10, 2018 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.