The illustration represents a diagram of how smart aggregation works for the query "SELECT dept, sum(sal) FROM emp WHERE country=‘USA’ GROUP BY dept".
There are three columns shown at the top, dept, country, and sal. Each column has 4 values. The values for dept are Sales, Eng, Sales, and Engr. The values for country are USA, UK, USA, and USA. The values for sal are 120K, 230K, 440K, and 380K. There is a dotted line around these columns, forming a group. From the bottom of this group pointing downward to a second group, is an arrow labeled Scan.
In the bottom group, there is a small table with two columns, dept and sum(sal). The values in this table are:
- Engr, 380K
- Sales, 560K