Omni demo ▶️ Aggregate Awareness

Omni · January 30, 2025 · 2:52

Transcript

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

  1. hi this is Connor from Omni I'd love to show you how to use aggregate awareness to run your queries much more quickly and efficiently to help you get faster insights Omni does this by swapping in aggregate tables instead of raw tables and your queries that don't require all of the granularity of the base table let's take a look so I have this order items table with a lot of information in it from when the item was ordered to the item id the inventory ID if it was delivered returned shipped and all this information is helpful for more complex analyses but often you'll just want a quick aggregate number like how many orders per user or how much has each user spent on the platform so

  2. I created this new aggregate query with just a few fields in it you'll see order ID user ID order items count and total sale price and then I used On's DBT integration to help us create that DBT model so I went to model hit push to DBT filled out some metadata here and then Omni helped us create that model so if I pop open to our DBT environment you'll see that this is the SQL that Omni helped us generate it's creating that model for us here and then I can actually pull that table right back into Omni so that's this order items a table here if I pop open the model definition for this aggregate query uh hit go to definition you'll see that there's

  3. this little parameter here called materialized query this tells Omni that this order items act table is an aggregated version of this order items table here with these fields in it so when you query something from the order items table Omni will check if this aggregate table is sufficient to answer your question and then if it is it'll pull from this smaller and faster aggregate table let me show you an example of that I'll head back to our workbook and I'll pull open this new tab uh I'll query something like total sale price and then I'll grab a field that isn't in the aggregate table like order status if I open the SQL that Omni is generating here you'll see that Omni is pulling from this

  4. order items table that raw underlying table as expected since status isn't in that aggregate table but if I swap out status for a field that is in that aggregate table like user ID you'll see that Omni is actually dynamically rewriting your query to pull from this order items a table instead of the raw underlying order items table and it's giving us a nice little message to let us know that that's what it's doing especially with big data sets aggregate awareness can be super powerful for your team and it's simple to implement you just add in that little bit of metadata into your model and Omni helps optimize your queries on the fly so that you and your team can get answers as quickly and efficiently

  5. as possible