Bring your own aggregates / in-database aggregate awareness

Steven Talbot · Friday Demos · April 19, 2024 · 7:54

Bring your own aggregates - aggregate awareness can now be configured in the data model for objects like dbt roll-ups. These can then be dynamic queries to reduce spend and improve…

Try it yourselfThe full week on docsmodelingperformance

Transcript

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

  1. uh I can go um make sure this all works uh so this is a kind of feature but so that we've added this thing that works but may or may not be useful um so there's this you have this table that I made in my local post Chris database called test a table and I know it's going to work because I literally copy pasted the SQL out of omni for a query and and created the table as that and then I added this funky thing down here which is saying that this Omni query very simple Omni query is the thing that describes the structure of this table so it's like a hint to the optimizer that like basically to treat this table like a very

  2. similar to how we treat our cach entries and swap it in um so if I go over here and so now I'm in the on the user's view quering the user's view but I can you know run a new query and I have to be careful to not hit the normal cache so like I'm just upping this limit um where looks normal but I get this thing down here that says uh basically I didn't run the sequel you expected me to run instead I ran this um so yeah that's great AG awareness or whatever it relies on this on the customer it's we we we've in the past we've called this like BYO AGS cuz relies on the customer basically having a table and then

  3. being able to describe that table exactly in terms of an omni query which is easy if you literally copy pastes out of omni with all other things it's probably a nightmare but on the other hand the people who are doing this and say looker are using it with liquid like inquery parameters which is perhaps even more of a nightmare so if they're willing to do that maybe they're willing to mess around with this uh so anyway we we'll probably tuck this in it it doesn't really even need a flag because it's so obscure um and people can will there's a some prospects that maybe want to try it and we'll see if it works for them um and is the descri the described by query

  4. is that syntax like the same as a normal yeah that's that's the same as a normal query view with all you know sorts this is such this is so mind-blowing and super exciting this is this you know we can basically help you know over time uh help folks leverage their existing ETL infrastructure too and do Dynamic query optimization for folks like it's not you know it's it it requires setup it requires us basically having this representation of of a query in the way that the en system can understand too but like God this is awesome and Stephen just logistically here let's say I build a dashboard with four queries on it and all of those queries could hit this materialized by query view are we

  5. going to run that view once and then all four of those queries and yeah yeah how does how does it sort of handle many queries well so that that's to be yeah to be clear this is not again like this is not that cool like it doesn't there is no this table must already exist the customer is telling us like this is a table that already exist so like there is no view to materialize or create but but it will it's not it I guess in like it's going to let you Cube your own dashboard now if you want to though like if we were cut off by the 50k row limit and now you need 500,000 rows you could go write this table with

  6. the 25 columns that you need yes M the dashboard to it assuming that we can have the description correct and that whole dasboard will now hit the cube but could drill to the this gives us aegs this gives us agess you know is when when we ship it it it is a step uh more work than than the ideal yeah where we actually manage the materialization or we manage the generation of the cube or like eventually to like we just build cubes on your behalf but like this lets us do aggre awareness today um and then the other thing put in this so This top level model parameter that I think probably this should be frore Capital FR cuz that's like the more official like

  7. local thing but anyway for now for this demo it's not in main yet just default numeric Cal France so I think I'm the same model and I was messing around with my local to get both these branches merged so hopefully it doesn't explode so anyway if we make age into something silly also I have no idea how these two If I multiply age this is going to be a good test of the new going awar in a feature like what exactly is going to happen here but uh okay well so did it hit the cach table no good I think that's good I'd have to think about that but uh the um the the point is of the demo is that these uh now it's

  8. in this French format the the commas are the thin space and the decimal SE separator is a comma uh and you'll notice be obligatory obnoxious question yeah what happens if you toggle to the viz oh yeah no I mean uh this well this down here is not being format there's like these don't take omn numeric formats okay there may be a way to force Vega into format them the ones that do take omn numeric formats which are mostly the uh let me just get rid of that one make it simpler what this worked yesterday oh well um I don't know why that's not working hard to can't have an integration test on the viz so it uh anyway that was working yesterday okay um should

  9. work is it oh well I don't know why that's not working but yes it will work in the viz um it it works in the there's a bunch of these places where we like display the uh the format options and like it should be formatting also these yeah like it's formatting the format options which is a little meta but like basically the options you can choose don't change just the way they're applied changes because it changes the uh localization under that um that's annoying I don't know why that's not working um but yeah it should it will work uh everywhere nice