Smarter Aggregate Table Selection with Row Counts

Steven Talbot · Friday Demos · November 27, 2026 · 1:47

Aggregate awareness can use stored row counts instead of table width to choose between eligible aggregate tables. This internally flagged Snowflake demo shows the optimizer selecting the…

Try it yourselfThe full week on docsaggregateawarenessmodelingperformance

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. Okay, uh quick demo of a new feature uh that we've added to aggregate awareness. Previously we used this kind of heuristic for picking the best uh aggregate tables with aggregate awareness on, just like how wide the table was, which worked okay, but uh when it didn't work uh especially if it was like catastrophically didn't work in terms of you could have a skinnier table that had more rows in it.

  2. Uh that was frustrating. So we're rolling out a new feature to have it just use the actual row counts. So here I have these two totally contrived ag tables. This one's built on order items, which is a bigger table than users, but this one is wider, and I have not turned the feature on. And if I go over here and do this very simple query that can be served by both, I see that it's using the order items table, uh, which is the less desirable table to use because it's bigger.

  3. Uh so now if I pop over here and turn the feature back on this little flag, uh then I come back over here and I see that okay, good. Now it's using users two. So it just it picked the right table because it it fetched, it had the row counts of the table stored already, and just using the feature uh it it picked a better table.

  4. Right now this is just behind that flag for kind of internal testing and uh only works for Snowflake, um, but we'll be rolling it out in the next week or so to uh mo most dialects, not behind the flag.