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?

  • 2
    I think "multiple copies of the same layer each with their own definition query and simple field based labeling" will go in as favourite but I have no metrics to back up that gut feeling so I think this is a great question. Would a file geodatabase feature class with one million polygons qualify as a very large dataset in your parlance? – PolyGeo Sep 29 '14 at 7:29
up vote 4 down vote accepted

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.

  • 2
    But, with the definition query scenario, I would not create label classes. They would just be labeled based on a single field value. Or am I reading the third paragraph incorrectly? – ianbroad Sep 29 '14 at 18:56
  • Label classes are used to label a subset of features defined by a SQL where clause (exactly the same as a definition query) and have their own text symbol, label expression, and placement rules. It's unclear to me from your description how moving from classes to a definition query allows you to label just on a single field. Are you referring to complex label expressions not complex SQL queries? – Craig Williams Sep 30 '14 at 4:47
  • 1
    No, I just mean that for both scenarios, neither uses a label expression. Both are labeled using a single field. – ianbroad Sep 30 '14 at 15:12
  • Label classes will be faster then as stated above. – Craig Williams Sep 30 '14 at 19:26
  • 4
    I work on the labeling team at Esri. I'm intimately familiar with how this works. Calling location of the query won't affect performance, but you'll want to reduce total queries. – Craig Williams Oct 2 '14 at 4:41

I ran a few very simple tests using some NHD data coming from an SDE connection and found very little difference between either method.

  1. 7 Label Classes in a single layer, also 7 separate symbologies: 36 seconds
  2. 7 Separate layers with definition queries, single label class in each with no query: 37 seconds

A few caveats:

  1. My test was very simple with simple labels and simple queries, complex queries should be tested since that was part of the question.
  2. About a third of the total time was for drawing the symbology.
  3. My timing was with a stop watch so margin of error is pretty big.
  • +1 for your tests. I wonder if it makes a difference whether label conflicts occurs or not? Perhaps you can enlarge the font size so that a lot of lables will overlap. Then disable place overlapping labels option. Is there a difference now? – Jens Oct 1 '14 at 15:13
  • 1
    Actually there was a lot of label conflicts in my tests because I had to show a large extent to get a really long processing time that I could easily measure. – jmpreiks Oct 1 '14 at 17:29
  • 1
    There's no such thing as "no label classes" as there's always one. – Craig Williams Oct 3 '14 at 7:58
  • True Craig, I edited my answer to clarify. – jmpreiks Oct 4 '14 at 11:33

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.

  • 1
    Yes, please test (and report back if you can). I also lean to definition queries, but for usability performance reasons. The label expression dialogs are painfully sluggish and several click layers deeper than the def query ones. They're also easier to get at in python. – matt wilkie Oct 1 '14 at 4:37
  • I don't think this qualifies as an answer without some sort of technical basis or quantitative testing. It might mislead some people. Would have been better as a comment to the original question. – jmpreiks Oct 1 '14 at 14:21
  • I would have done that if I had the capability to comment. Thanks for the down vote. Just trying to help out. – geogeek Oct 1 '14 at 18:18

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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