Which would provide the best performance for working within ArcMap with very large datasets stored in an ArcSDE geodatabase? Multiple label classes using complex SQL queries to label specific features, or multiple copies of the same layer using the same complex SQL queries set as a definition query for each layer?
Assuming the SQL queries on the label classes are the same as the ones on split out layers, the single layer approach with multiple label classes will be faster. Why?:
Labeling in ArcMap will execute one query for the layer draw and then one query for each label class. So a layer with 4 label classes will query once (1 query) for all features drawn and then 4 additional times total (one for each label class or 4 more queries) = 5 total queries
If you split the layers out, you'll have 1 filtered query (definition query) for each layer (4 queries) plus that same query for each label class (4 more queries) = 8 total queries
In almost all cases, 5 queries will be faster than 8 queries due to just plain query overhead although it depends on the data source.
Note, in ArcGIS Server a cache is used for feature labeling and 1 layer with 4 label classes will most likely be handled via one query when the label classes use fairly standard SQL without vendor specific functions.
I ran a few very simple tests using some NHD data coming from an SDE connection and found very little difference between either method.
- 7 Label Classes in a single layer, also 7 separate symbologies: 36 seconds
- 7 Separate layers with definition queries, single label class in each with no query: 37 seconds
A few caveats:
- My test was very simple with simple labels and simple queries, complex queries should be tested since that was part of the question.
- About a third of the total time was for drawing the symbology.
- My timing was with a stop watch so margin of error is pretty big.
I think the definition query would be faster because it's at the object level and not at the attribute data level.
You would still have to test. However I would use definition queries and not label classes.