A quick tour of managing intermediate data
When a model is run, output data is created for each process in the model. Some of this output data is only created as a middle step to connect to other processes that will create the final output. The data generated from these middle steps, called intermediate data, is often (but not always) of no use once the model has finished running. You can think of intermediate data as temporary scratch data that should be deleted after the model has run. However, when you run a model from the ModelBuilder window, intermediate data is not deleted—it is up to you to delete it.
Learn how to delete intermediate data
All the data variables except existing data and the final output variables are automatically marked as intermediate in a model. To determine if a data variable in a model is considered intermediate or change the status of a variable that is intermediate, right-click the variable and click Intermediate to either add or remove the check mark next to it.
To prevent the final output variables from being deleted, It is strongly recommended that you do not set the final output variable as intermediate data.
Learn more about preserving intermediate data
Controlling where intermediate data is written
Geoprocessing tools that create new output datasets autogenerate the name of the output dataset (as described in Using the current and scratch workspace environments). This autogenerated name includes the path to the workspace or folder containing the dataset. ModelBuilder uses this autogenerated output name for writing intermediate data. You can always override this output dataset name by entering another name and location for the output dataset, and there are ways you can specify the workspace used to construct the autogenerated output name.
When you're working in ModelBuilder, it is easy to ignore this autogenerated output name, especially for intermediate data. But there are situations where you want to control where intermediate data is written.
- You never want to write intermediate data to an ArcSDE geodatabase. This causes performance problems since you are writing temporary scratch data to an enterprise database across a local area network. It's suggested that you always use a file geodatabase (rather than a personal geodatabase or a shapefile workspace) for the scratch workspace.
- You want to avoid cluttering a working geodatabase with intermediate data. Rather, you should designate another workspace, preferably a file geodatabase, where intermediate data is written.
To control where intermediate data is written, you can do one of the following:
- Right-click all intermediate data variables and change the location where they are written. This is a poor choice, especially if you have a lot of intermediate data.
- Set the scratch workspace environment as described in Setting current and scratch workspace environments.
- Make your intermediate data managed data, as described in Making intermediate data managed data.
For an in-depth discussion of intermediate data, especially as it pertains to model tools that you are sharing or publishing to ArcGIS Server, see Managing intermediate data in shared models.