Select to view content in your preferred language

Arcade aggregate functions: Does the DB or the app do the aggregation?

476
2
03-19-2023 12:47 PM
Labels (1)
Bud
by
Esteemed Contributor

Regarding Arcade aggregate functions like GroupBy():

What level of the stack does the aggregation/processing?

For example, does Arcade generate an SQL DISTINCT or GROUP BY query and send that to the database? (in my case, Oracle)

Or do all features get returned to ArcGIS Pro, and ArcGIS pro does the aggregation locally?

Tags (2)
0 Kudos
2 Replies
jcarlson
MVP Esteemed Contributor

For the most part, the database. You can turn on your browser's dev tools and watch the GET requests sent off to the server, and you guess correct, it generates and sends the appropriate aggregate query to the REST endpoint.

However! You can have a FeatureSet created manually (like a Data Expression in a dashboard) and still use aggregate functions against them, so it's clearly doing the work locally in such cases.

I didn't document any of it, but I did some random testing of the very thing you're asking, and even very convoluted expressions (think multiple aggregations and filters in sequence) still seem to be compiled and sent off in as simple a query as possible. For instance, getting a FeatureSet, then calling Filter and GroupBy on it is not 3 server requests, it's just one, but with the appropriate parameters filled in.

- Josh Carlson
Kendall County GIS
jcarlson
MVP Esteemed Contributor

Sorry, my answer was a bit web-specific. You'd need a different program like Fiddler to watch the network traffic generated by Pro, but I'd be willing to be it's the same over there.

- Josh Carlson
Kendall County GIS