Skip to main content

10ms Queries on Iceberg: Turbocharging Your Lakehouse for Interactive Experiences with Firebolt

Summary

  • Low-latency Iceberg support: Firebolt enables 10ms queries on Apache Iceberg data, solving a key challenge—interactive analytics on open table formats—typically requiring transformation into closed systems.
  • Performance architecture: Learn how modern query engines leverage caching, adaptive object storage reads, subresult reuse and multi-dimensional scaling to achieve low-latency analytics on Iceberg.
  • Interactive applications: Discover how to build real-time dashboards and interactive data applications directly on Iceberg tables stored on object storage, eliminating data movement and latency.

10ms Queries on Iceberg: Turbocharging Your Lakehouse for Interactive Experiences with Firebolt

Watch: 10ms Queries on Iceberg: Turbocharging Your Lakehouse for Interactive Experiences with Firebolt
Talk by Benjamin Wagner, Vice President of Engineering, Firebolt (Sponsor Speaker)
Open table formats such as Apache Iceberg or Delta Lake have transformed the data landscape. For the first time, we’re seeing a real open storage ecosystem emerging across database vendors. So far, open table formats have found little adoption powering low-latency, high-concurrency analytics use-cases. Data stored in open formats often gets transformed and ingested into closed systems for serving. The reason for this is simple: most modern query engines don’t properly support these workloads. In this talk we take a look under the hood of Firebolt and dive into the work we’re doing to support low-latency and high concurrency on Iceberg: caching of data and metadata, adaptive object storage reads, subresult reuse, and multi-dimensional scaling. After this video, you will know how you can build low-latency data applications on top of Iceberg. You’ll also have a deep understanding of what it takes for modern high-performance query engines to do well on these workloads.
Intelligent analytics for everyone: https://www.databricks.com/product/business-intelligence
BI meets AI: https://www.databricks.com/resources/ebook/business-intelligence-meets-ai
Explore the only unified platform for agent systems: https://www.databricks.com/product/artificial-intelligence
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements

FAQs

Why is low-latency on Iceberg important?

Most analytics on Iceberg require transformation into specialized systems for performance. This video shows how Firebolt enables low-latency queries directly on Iceberg, eliminating data silos.

What techniques enable 10ms query performance?

Firebolt uses intelligent metadata caching, adaptive object storage reads to minimize latency, subresult reuse across queries and multi-dimensional scaling to handle high-concurrency workloads.

Is a data lake or a data warehouse better for cloud object storage?

Data lakes on cloud object storage offer superior flexibility and cost efficiency compared to traditional data warehouses, but traditional query engines struggle with the latency overhead inherent in object storage architecture. This video showcases how Firebolt enables 10-millisecond queries directly on Iceberg table formats through intelligent metadata caching, adaptive reads, and multi-dimensional scaling capabilities. By eliminating the need to copy data into closed-format systems, organizations gain both the flexibility of open formats and warehouse-class performance for interactive analytics.

Best open table format 2026

Apache Iceberg stands as the leading open table format for 2026 due to its comprehensive metadata model, support for schema evolution, time-travel capabilities, and broad platform support across Databricks and other vendors. This video demonstrates Firebolt's deep optimization of Iceberg performance, achieving sub-10-millisecond query latency through techniques like hierarchical metadata caching, subresult reuse across queries, and intelligent file pruning. With support from major platforms including Databricks' Unity Catalog integration, Iceberg continues gaining enterprise adoption for high-performance analytics workloads.

low latency analytics platform

Low-latency analytics platforms must address both metadata traversal overhead and query processing efficiency, as object storage introduces inherent latency challenges not present in traditional file systems. This video explores the technical challenges of querying Iceberg tables on object storage, where metadata hierarchies can require hundreds of milliseconds to traverse, and shows how modern query engines like Firebolt overcome this through intelligent caching strategies and optimized join ordering. The result is interactive dashboards and real-time business intelligence directly on data lake infrastructure without performance compromises.

Full transcript

Hi everyone. Um, good. I'm, VP engineering at Firebolt. Uh, and today I'm excited to talk to you about the iceberg support we've been building into our product in the last couple of months. Um, this will be a pretty technical talk. So I really want to give you an under the hood look of how modern query engines kind of uh need to work in order to give low latency on iceberg. At the end for those of you kind of who've done this stuff before I also have a live demo prepared so hands are a bit sweaty.
I hope everything will go well. Um but looking forward to then showing you all of this in action on Firebolt. All right. In terms of the structure, first of all, who of you here has heard about iceberg? Okay, good. So this is perfect like then kind of I can keep the iceberg 101 pretty short. I'll move on to talking about why low latency on iceberg is actually hard. This is when we'll start to become more technical and then for most of the presentation the third part I'll actually explain kind of how we're solving low latency on iceberg in firebolt.
At the end I'll give a demo open up to questions uh and excited to chat with all of you. All right. So all of you know that iceberg is basically an open table format for analytic data sets. So it takes the data files like per key or arro you have stored on object storage for example and basically builds rich metadata on top of that. So it introduces the kind of concept of tables partitioning all of these things uh in order to give you rich metadata on top of your raw data files uh on object storage.
With iceberg, you're able to do things like schema evolution on your open table format. Time travels going back in time to kind of query the state from a couple of days ago. Things like asset transactions are also possible in iceberg. And to the right here, you'll actually see how iceberg works under the hood. At the very top, you have an iceberg catalog. So this is the thing your query engine connects to in order to be able to understand where to find the metadata description on object storage.
At that point there's a hierarchical sequence of different files that point to each other that a query engine reading from an iceberg table needs to traverse to understand what data files are currently part of your table. The cool thing about iceberg is that it allows for interoperability between query engines. So the nice thing is you can basically pick whatever query engine performs best for your workflow and start to mix and match query engines to build a really efficient data stack.
Iceberg is investing heavily into uh data bricks sorry is investing heavily into iceberg. So today in unity catalog you can already create iceberg tables. You can consume tables both using iceberg and delta. um and kind of yeah there's continued innovation here and I think a lot of the kind of announcements as well kind of cover iceberg in some way. Perfect. So with that background on iceberg let's start to understand why low latency on iceberg is actually hard and for this we need to start with modern object storage.
Usually you could store iceberg tables on your SSD on your I don't know like Hadoop distributed file system. People don't really do that anymore. Nowadays, pretty much all iceberg tables are managed on object storage. And object storage is amazing. It's fault tolerant, replicates data, durable, gives you high throughput if you know how to use it. Well, the big problem is access latency kind of takes a pretty long time.
So this is a kind of a figure from a paper from our friends at TU Munich where you see the access latency kind of to access differently sized objects on uh object storage in this case in EU central one on AWS and what you can see is that even for tiny files or tiny objects on object storage you'll need at least kind of 25 to maybe 50 milliseconds with pretty heavy outliers to read that. As your files get bigger, you need to start reading the whole file as well.
And it gets slower and slower. So at one megabyte, which is still not a lot of data, you're actually up to maybe like 100 milliseconds to read that file from object storage. For 4 megabytes, you will can suddenly see hundreds of milliseconds of access time to just read a single object from object storage. Now, if we return to the architecture sketch I showed you of iceberg, you can start to see why this becomes a problem. because you have hierarchical metadata and you need to traverse that step by step to discover the different files.
You need to pay that access latency on object storage every time kind of you traverse through that hierarchy. So I'll go to the iceberg catalog the first time. That takes some time for it to tell me where the metadata file is. Once I'm in the metadata file, I can set check the current snapshot. Only then I actually discover the manifest list. Once I discover the manifest list, I need to jump again to the manifest file.
I've jumped like four times now. I still haven't read a single bite of actual data within my underlying table. Only at the very end, I need to read the larger data files, which takes then even longer. So with this hierarchical metadata structure on object storage, if you add up the latencies, it will actually be pretty hard to get below 500 milliseconds. And again, you haven't done any query processing at this point.
So basically, you're paying half a second to just resolve your current snapshot of the underlying iceberg table. Then we go to the second hard part. And the second hard part is actually all of the query engine internals. Right? So let's take a look at the sample query for example, kind of based on the TPCH schema. There's a bunch of things your query engine needs to do after resolving metadata to actually evaluate this query.
It all starts with data access. So I need to load the actual per key files that are stored on object storage from S3 GCS Azure blob storage. I need an efficient reader for that. So something that can leverage object storage well kind of do nice column access has good fast decompression logic and so on. The queries you run are complex. So they might have multiple different joins. And as you know, join ordering is a kind of really important part of any modern kind of database system.
And so also on iceberg, I need to figure out what's the right join order to join these different iceberg tables to give you the lowest possible latency. Many queries will have selective filters. Right? When you look at a dashboard, you're not looking at all your historical data. You may be drilling into yesterday, today, the last two hours. And for a query engine, the less data you read to answer your query, the faster you'll be, right?
Even if you have 10 terabytes of base data or 100 terabytes of base data, if your query engine is smart enough to figure out that it only needs to scan a couple of gigabytes within that larger table, it's going to become really, really fast. The final part is you need to do the actual join processing, aggregation processing, all of that's done within your database runtime and that needs to be really efficient as well.
So you want like a high performance runtime that can do multi-threading that has vectorized execution all of these things you know about modern high performance query engines. The final part is you need to size your compute right. If you have a 100 terabytes of data and each of your query kind of scans 100 gigabytes and you still want to kind of have let's say sub-second query latency, you probably need to scale up or scale out.
So whatever platform you have needs to give you options. In the same way, you need to be able to scale for concurrency. If you only have 10 queries per second in the morning, but expect a thousand queries per second kind of during some peak hour during the day, you need a system that's able to respond to that. All right. And with that, let's now talk about query engine internals and how it firebolt can we've been working over the past nine months to actually bring low latency to iceberg.
All right. And let's start with metadata. And this is kind of what we said earlier is already stopping us from even getting below half a second. And honestly, half a second at least we think that's still a pretty long time. What we're doing is kind of the magic happens in this firewall SQL query you see here. So let's say we're looking at the kind of different attendees and we look at the favorite session of each of you kind of at the data and AI summit and we have this stored kind of in an iceberg table.
What we introduced is this maximum staleness parameter on iceberg tables. And it allows you to say that the read from your iceberg table can be 1 second stale, 10 seconds stale, a minute stale, 10 minutes stale. Really depends on kind of what level of freshness you're fine with. The cool thing is once you introduce the staleness, we can basically move metadata lookup out of the hot path of a query. So what Firebolt will start doing is it will start refreshing over time in the background the metadata outside of the hot path of your query.
Let's say we're running it with 10 seconds. Then every 5 seconds in the background we can go to your iceberg table or your iceberg catalog, load the metadata into main memory of the current snapshot. And once you send the actual SQL query, we don't need to do any checking in the iceberg catalog or this hierarchical traversal on object storage. we can basically instantly figure out what files are part of your current snapshot and start query processing immediately.
All right, so with metadata access solved, we now need to solve all of the other hard query uh kind of query engine problems that I mentioned earlier. Iceberg fundamentally is tied to park. Most of your data at least if you don't have kind of like trickle inserts or something like that will be stored in park key files. Who of you knows how a park key file looks on the inside? Like who of you has looked at the kind of specification in the past and knows how it's structured?
So, first of all, very cool for those of you who do. Since not everyone does, I'll kind of give a quick rundown of this. At the end of your park key file, there's a page index and a par footer. This contains metadata about the file. And this contains things like the format version, different encodings that are used. So, something like snappy compression, dictionary compression, all of these things. It contains the row count within the paret file.
It contains skipping indexes. So minmax zone maps for example. And probably the most important part, it contains a variety of different offsets within the file. So once you read the par footer, you're basically able to tell where different segments of data are located in the file. The pari file itself is split into individual row groups. Each row group is kind of a collection of rows that are then stored in a columner way within that row group.
And the indexes or these offsets I mentioned earlier in the footer will basically point to the beginning of the row group for example to the beginning of a column data page and so on. Within the row group, we put one column after the other. Uh or not we like per key as a standard. Um, this is really important because it gives you first of all column access. If you have 200 columns in your paret file and you run a SQL query that only scans five of them, it means that if your par reader is really smart, it can start skipping kind of certain parts of the park file to not have to read the 195 columns you don't really care about.
The other part is that column storage gives you way better compression if you put your data in a column layout. uh and then kind of similar values will be close to each other. You can do things like dictionary compression, things like LZ4 compression will kind of suddenly start working better because you have more homogeneous data. Um so all of that basically helps you. Final part not that important for that talk but maybe interesting within the individual column stored in the row group there are data pages in the park key file and the data page is basically your minimum granularity of access.
So these are compressed independently and you could read just data page one of column A for example if you know how to navigate within the file based on the park key metadata. Perfect. And with that out of the way we can start taking a look at how we're building data access on top of these par files in Firebolt. To the right here you basically have the different levels of the memory hierarchy. So you probably know this from your computer science classes, the closer you are to your CPU caches, the faster things become.
If you have data stored in memory, you have about 50 nanose of access latency. So that's just a couple of CPU cycles. Well, couple of hundred of CPU cycles and things are pretty fast. Once you go to disk, even on SSDs, this access latency quickly grows to about 100 microsconds. So that's a 2,000 times kind of increase over going to memory. If you can avoid going to disk, avoid going to disk. At some point, you'll hit the network boundary within your data center.
And then things start to become really slow. And we're back to this kind of access latency I've shown you earlier on modern object storage. You can see that going from disk to cloud object storage gives you another 1,000x in terms of increased access latency. So you go from about 100 microsconds to 100 milliseconds. There's this nice like an analogy that if you sit in a room like your CPU caches are kind of your desk.
Uh your main memory is maybe going down to the kitchen going to disk is like going to the store and then going to cloud object storage will be like I don't know going to the moon or something. Um perfect. And with that we are kind of starting to see why we really don't want to go to cloud object storage every time we touch a park key file. And this is even more true if you have a homogeneous workload. So if you care about low latency analytics and you would want to power a dashboard for example, there's a good chance you'll scan the same park key files for different queries over and over again and kind of this is where the park key layout and our multi-tered caching come into play.
We put one par file for the sake of argument onto object storage. Here we have this footer at the end of the file containing metadata and then we have column X one out of many columns that's stored. Let's now say we have two queries coming in that actually want to access that par file. There's no metadata overhead. We had all of that cached in main memory and they care about scanning column X to locate column X within the park key file.
The first thing they need to do is look at the metadata to find the right offsets. So we'll pay the 100 milliseconds to go to cloud object storage once load it into main memory. look at the offsets and then we can kind of uh we'll write it back to disk. And writing it back to disk is a super important part of this process. Basically, we're adding this ephemeral caching layer on your local SSDs and in main memory so that future queries don't have to pay the access latency to go to cloud object storage.
As I load it into main memory, the background process will flush data to disk and then okay in this case query one will also go to object storage one more time reading column X and the same thing happens. So once column X is loaded into main memory it gets written through to SSD which you will see here and at that point query one can finish it read all its data does query processing and returns the result to the user.
Now things start to become interesting once I send another query. Let's say kind of some time goes by, there's eviction happening because maybe you need main memory for other queries during processing. So we evict column X for example from main memory. It's still stored on disk and disk is pretty cheap. So you easily have terabytes of data on kind of clusters in modern cloud environments. Once query 3 comes in, it will again start with accessing metadata.
Metadata stays in main memory at this point. So within 50 nconds I'll know what the right offset in my perk key file is to start reading actual data out of that column. And at this point we don't have to go to object storage to read column X. Firebolt realizes that it has that data still cached on SSD. We'll load it from SSD within 100 microsconds. Uh do the query processing and return it to the user. So this basically is like a sparse caching on top of par files.
We could only store five or your most 10 frequently used columns in the park files on SSD. But as you do query processing on top of them, you'll enjoy very very low access latencies because we never have to go to object storage to serve hot queries. Perfect. Now at this point we can start looking what happens during query processing. Right? All of you understand how to make data access on parast. You know how to get data into the query engine.
Now we need to do joining aggregating kind of all of these things. And the beautiful thing is that iceberg has really rich metadata we can integrate with as a query engine to make all of this efficient. And let's start with figuring out how we can use iceberg metadata to do joint planning. So returning to our earlier example queries, we're joining orders, customers, and nation. If you know TPCH orders is the bigger table here, customer nation are smaller.
So we'll probably want to join them earlier. Um, and at this point we need to figure out as the query optimizer of Firebolt what to do in terms of the join order we want to pick. And the cool thing is since row counts are stored with an iceberg metadata itself, we can leverage that to actually fetch the row counts ahead of time, feed these into our statistical estimators and then choose a good join order. And the way this works within the query engine is that we actually run a SQL query itself to retrieve metadata for our iceberg table.
What I will do is I will list the iceberg files for my orders table. for example, use the same staleness that the user specified within their SQL query. And then for each kind of I'll get one row within this list iceberg files function that we built into Firebolt for every per key file that's in my iceberg table and I get the record count. If I now do an empty group by and just take the sum of record counts, I'll suddenly get the number of rows within my orders table.
One thing that's really important here is that if you we return to the first thing in terms of metadata access, we have all of these record counts already cached into memory at the point where we resolve the iceberg metadata. We loaded that onto SSD into main memory kind of we stored all of this in in-memory tables. So running this query is super lightweight. We take our cacheed main memory metadata, compute the sum of records for the current iceberg snapshot and all of a sudden we know how many rows there are in orders.
In the same way, we'll know how many rows there are in customer nation and based on that our join ordering algorithm can choose a good join order. This is just one of the ways we can use iceberg metadata to pick smart query plans. Another thing that's really interesting is using information such as iceberg partitioning metadata to choose better physical plans. Right? You might be running your query on a cluster of 10 machines and you want to find a physical plan that does that as efficiently as possible.
And if you've used Spark before, I guess many of you have kind of all of you will know shuffle. Who of you know shuffle? Just to quickly check. Okay, so kind of quite a few people. That's basically the operator used to scale out query plans onto a cluster of machines. The fewer shuffles you have, the faster queries you become. The hard part when you process a query like this in a distributed fashion is that you need to figure out the different join partners, right?
You need to take the rows from orders and the rows from line items that have the same join key oer key equals L order key and actually then kind of combine them. For this these rows need to be on the same node. So you need to take your maybe 100 terabyte table figure out which node is responsible for which part of the data and then do a local join of a fraction of the data on each of your node. Usually we would have to scan the table hash shuffle for example by O order key and L order key in the same way do a local join after the shuffle and then continue query processing.
The nice thing is we might know from your iceberg table that it has bucket partitioning into 256 buckets on the join keys. So if you have bucket partitioning on a O order key and L order key for orders and line item respectively, our physical query optimizer can find a query plan that colllocates the same partitions on the same nodes to avoid a shuffle. Let's say we have 64 nodes in our cluster in this case. So four nodes for each bucket.
What will happen is that the first node is responsible for bucket zero, one, two, three. The second node is responsible for buckets four, five, six, seven and so on. And it loads those bucket of orders and line items respectively and does a fully local join. At this point, you don't have any shuffle in your query plan to actually compute the scale out joint. The same trick works for aggregations. I don't want to go into too much detail here, but basically what we can do is that if we see for example that there's bucket partitioning on our group by key, we can skip a pre-agregation step, eliminate a shuffle and just do a local merge aggregate over the buckets that a certain node in the cluster is responsible for.
All right, so this will be my final slide on metadata. Then we'll move on to other things. Um, but this is one other cool thing I want to show you. So, you've seen how we can basically write within our query optimizer a metadata query to fetch iceberg row counts that we feed into our joint planner. We can do a very similar thing to actually do file pruning on par files within iceberg. Iceberg stores the minimum and maximum over columns for the individual paret files.
So as firebolt resolves iceberg metadata it will see hey here's a file that has that minimum that maximum for this column etc. So in our query earlier we had this filter on o order date where I look for the 1st of January 1998. What we will now do is we can expose this again main memory metadata table that for each iceberg data file contains the minimum of O order date for that column and the maximum of O order date for that file.
You will see for example that orders one uh has data between the 8th of January 2024 and the 11th of June 2025. Orders two has very old data from 1970 and order three has data from October 1997 to August 1999. Now the nice thing is we can actually build a metadata pruning expression within our query optimizer to not scan the files that we can disqualify. If I'm filtering on 1998, I will know that a par file that has minimum date 2024 will have zero rows that qualify this filter.
In the same way, I will know that orders two has a maximum of 1970 and hence zero rows that qualify this filter. What we're doing is that as we resolve the iceberg files we need to scan, we basically evaluate this predicate on top of this metadata table. So we ask hey is 19 80 19998 1st of January between the minimum order date and the maximum order date of that file and only if that's the case we even touch the park key file again all of these predicates are super fast there's no object storage access here everything is stored in main memory these falsifiable expressions this is what it's called kind of when you read database papers about this type of metadata pruning also work for way more complicated expressions you can build these uh predicates for conjunctions, disjunctions, larger equal, smaller equal, unequal predicates and so on.
So this is basically like an expression we write within our query optimizer that turns your query level predicate into a falsifiable expression on top of these metadata tables. Perfect. The final optimization before we come to the demo that I want to show you is um the actual sub result reuse that we do. And I think this is one of the optimizations that we're really proud of and that are pretty fancy that you might not have seen in other systems at all.
Let's say we again have our join query the filter on O order date and we group by the nation name and take the sum of the orders kind of within that nation and the number of orders within that nation. Your query optimizer will build a query plan that probably looks like follows. We initially do the join between customer and nation table and then we join that onto the largest table orders. Every join has a build side and the probe side.
So if you evaluate a hash join kind of in your database, you need to build the hash table with the smaller side and then probe into that hash table with the larger side of your uh of your query plan. What Firebolt does now is each plan fragment within your query plan is fingerprinted with something similar to a cryptographic hash function. We basically take the snapshot that your base tables are running on and then propagate this hash upwards through the query plan to tag every node in the query plan with a respective hash. the individual nodes in the query plan can then take computational artifacts from their operator and cache them in main memory for future queries.
So if we for example evaluate a hash join, the hash join knows its fingerprint within the query plan and it says hey if there's main memory left on the machine kind of extend the lifetime of this hash table keep it around this is the fingerprint. The next time a query comes in that has the same fingerprint, it can actually kind of stop doing any processing for that sub plan, pull the hash table from our main memory cache and just compute with that.
And this is a very very nice optimization for homogeneous workloads because in many cases when you do dashboarding or have customerf facing data apps you will see the same general structure in your queries over and over and firewalt will realize this and basically do workload level optimization to make things really efficient. Here's for example some production telemetry kind of from July of last year where you see how much we save in our production fleet by leveraging sub result reuse.
You can basically see that we save on most days more than 10 times as much time on sub result reuse than the time we spend on building these hashts for example. So throughout our production fleet and kind of with our customers, this is actually a really powerful optimization when they run these homogeneous kind of workloads where they have similar structure but different queries all of the time. The final thing I want to talk about is uh multi-dimensional elasticity and this is what I mentioned about kind of having flexible compute earlier.
In Firebolt you can scale in any dimension you want. You can scale up. So you can go from a small node to an M node, L node, XL node. This will stay on one EC2 instance for example in AWS and just give you more and more CPU cores. You can scale out from one 2 3 4 5 6 7 to up to 128 nodes. And you can scale for concurrency, meaning you can have multiple independent compute clusters behind the same rest endpoint and resize this dynamically during the day um to change your kind of readiness for different QPS requirements that you might have.
One last thing there in terms of scaling out, we don't just have t-shirt sizes for that. So you don't always need to double. You could go from two nodes to three nodes, four nodes to five nodes. kind of if you have very fine grain control to make sure you don't pay more than you have to actually run your workload. All right, and with that, let's get to the part that gives me sweaty hands, which is the demo uh and kind of hope that things will go uh as expected.
All right, so I'll press button one here. Perfect. All right, and so this is live kind of I set everything up before the talk. Um so yeah be kind with me. Um what you will see here is that first of all we're in data bricks right now and in data bricks unity catalog we set up amplab tables. Amplab is like a well-known benchmark for large scale analytics. So we have about one terabyte of data ingested into data bricks here.
Uh and there are different tables agents IP addresses rankings. This is basically web data uh that's used to evaluate modern analytical query engines. Let's take a look at one of these tables in data bricks. You see that from our team actually set these up for the demo. You will see that there's five different columns in here. So there's an ID which is an integer, some text columns, etc. The interesting part is when you go in data bricks in your uniquity catalog to the details of this table, you will see that enable iceberg compat v2 is set to true.
And this is all you need to do on your data bricks unity tables to actually make sure data bricks produces iceberg metadata. So for this table there's both iceberg metadata and delta metadata and query engines can basically choose through which open table format they want to consume this query. If you've been kind of reading some of the data bricks announcements delta and iceberg are also getting closer together kind of every day.
Uh so the iceberg support I think within unity catalog will just continue to improve. All right, at this point we're exposing iceberg metadata from within data bricks and I should be able to use any query engine I want that supports iceberg to start reading that data. So let's hop into firebolt uh which I set up here. What you will see is that I'm running in a firebolt database. I have this demo engine which is a 1M engine started right now.
1M is the second smallest engine we have. So this will cost kind of a couple of dollars an hour, maybe like three or something like that. This is not a very expensive compute cluster. So there's kind of like this is scaled up a bit. It's not scaled out at all. And we're running all of this on one terabyte of raw data. The first thing we'll take a look at is we'll query information schema. loations. And information schema. loation basically contains the different iceberg tables we have set up to connect to data bricks.
I need certain credentials kind of if I need to make sure we reference the right tables. This is done through a location object in Firebolt and I can query metadata here. By the way, throughout the demo, I'll show you some of the friendly SQL improvements we have in Firebolt. So you could also write select star from information schema. loations, but to make it easier for you kind of you also can write from first and just project all columns directly.
We also support pipe syntax. So this is something data bricks recently added. Firebolt supports that too. If you've checked that out and you enjoy using it, you can use pipe syntax in firebolt as well. You will see that each of these locations that were set up here basically kind of has some DDL associated with it. There's in this case stripped credentials and we reference different tables. If we go into firewall documentation kind of you will see here how to actually set up the location that goes against Unity catalog.
You will see you define your workspace instance catalog schema table and credentials and once you've set that up that's all you need to leverage this read iceberg table valued functions that I've shown you in some uh examples earlier to start querying all right so at this point let's start jumping into some actual queries and we will start with a query that doesn't have any staleness set so this is the thing I mentioned earlier where you need to hierarchically traverse metadata in order to resolve things.
And you will see that this very basic query is not going to be super fast because we need to do this hierarchical traversal of metadata. By the way, I just brought up this cluster before the demo. At the moment, everything is on object storage. So there's nothing cached on SSD, nothing cached in main memory. All right. So let's read 10 rows from this. And you see it actually took a while. So I think it took about two seconds to read these 10 rows. and fireball needed to go to object storage probably 10 20 times at this point to resolve hierarchical metadata uh and all of these things in the end you see the 10 rows here and honestly like this is pretty cool like this was ingested into data bricks you just set it up in unity catalog and suddenly other query engines can start reading this all right let's now jump to this max staleness so we say in our demo that the read can be up to 5 minutes stale within unity catalog.
The first time I run this, Firewall needs to check the current snapshot. So you will see that the first query takes in this case about 600 milliseconds. This is already faster than the one before because my first paret files are starting to be in SSD cache in main memory. However, I still need to prepare the metadata of the current snapshot. This is where things get interesting. The second time I run this now with the max steness set to 5 minutes, what you uh Wait a second.
Um what you will see is that the results come back instantly and if I look at the table stats uh this actually ran in 10 milliseconds. This is because Firebolt cached all of the metadata for the snapshot in main memory was able to use this and then return the query results to you. The same thing will also work for other iceberg tables here. So in this case I'm scanning the rankings table. You see the first time needs to load par files, hierarchical metadata, etc.
I get some of the ranking data and the second time I run it, it comes back instantly because Firebolt has all of the metadata and kind of data files cached and again the query runs within 10 milliseconds. Now you're saying, okay, that's cool, but like it's a toy example. Limit 10. This is not how my queries look in the real world. Let's start to do some serious data processing on top of this. In this case, I'm using some of the AMPLab benchmark queries.
And this is actually the hardest AMLAB benchmark query. So, this um query basically does a join and an aggregation on top of relatively large tables. You will see here in the from clause that I drew a join of user visits onto rankings with staleness 5 minutes. I do filters for the 15th of January 2000 and page rank 10. and I aggregate by country and for each country I compute the total ad revenue. This is going to do some more heavy data processing now.
And as I run this, this is exactly what you will see. You can see that we're actually scanning a couple of data gigabytes of data now. Nothing here is actually cached on SSD yet. So this is Firebolt going to object storage and reading a couple of gigabytes every second to ultimately return the query result. You will see on the small cluster it took us about 8. 8 8 seconds here to read 20 g or 18 gigabytes from S3 and return the query results.
Now there's a few interesting thing to point out here. First of all, you can make this query a lot faster by scaling up or scaling out, right? Like this is the beautiful thing about elastic compute on the small cluster. We're reading about 2 gigabytes, so 16 gigabits a second of data from S3. I can tell you that similar to the network bandwidth we have available on that machine. This is like at the physical limits of what we can do basically reading the park key files.
The other part that's interesting is you see pruning in action. So we used all of the iceberg metadata to locate the right parts of the underlying tables to not have to scan the full terabyte of data that's in these tables. We're able to narrow it down to just scanning 20 gigs. And because of that, the query well still takes a couple of seconds, but at least I'm not scanning a terabyte. All right. So, at this point, I have my results, but it's kind of all over the place.
Like, okay, there's some revenue here, like 24, 24, 18. I want to know the country codes that have the most revenue. So, let's take exactly the same query, but now add an order by clause that orders by descending ad revenue. And this is where stuff gets interesting. If I now run this query, what you will see is that it came back instantly. So this took about 40 milliseconds. And you see the revenue is nicely ordered.
This is sub result reuse and firebolt in action. I saw I'm running on the same snapshot. My order by or earlier my kind of aggregation result put this transient intermediate result into main memory. Firebolt matches that during execution against our sub result cache and can then just reorder that query result. Um, exactly. Now adding an order Y on top kind of that's nice. Let's do a deeper change to this query. What you see is that so far we looked at the 15th of January for websites with page rank 10.
Let's move one day to the 16th of January. At this point we have to go back to object storage, right? There's other park key files that contain data from the 16th of January that I need to load from object storage. So I don't get around some object storage access here. However, if I run this, what you will see is that it's still way slower faster, sorry, than the initial query we ran on January the 15th. In these 740 milliseconds, we read about 350 meg or 340 megabytes from S3 and not these 9 GB anymore.
Here as well, this is sub resultile reuse in action. Let's take a look at the query plan to see under the hood what's going on. I'm also seeing I'm running out of time. So I'll be very quick here. What you will see is that within the join that was executed, some time was spent in the join. But if you look at the build side of the join, no CPU time was spent in that. That's because we only changed the filter on the probe side and the build side of the hash join kind of stays on the same fingerprint and we can reuse that sub result to accelerate this query.
This even works if I make deeper changes to the query structure. So if I for example add a second aggregation key, you will still see the same thing. sub result reuse is going to kick in and you don't have to scan tens of gigabytes of data to answer your query results. All right, so this brings me to the end of my demo. Um, and at this point kind of my conclusion is very brief. Iceberg is amazing. It allows interoperability between different query engine and data bricks is driving a lot of innovation on iceberg.
What this means is that if you have Unity tables, you can start to use other query engines to accelerate some of your workloads. At Firebolt, we focus on accelerating low latency analytics. And what you've just seen in the demo is basically that in action. So, we bring low latency to iceberg tables by using a lot of kind of fancy engineering under the hood. At this point, yeah, if you have any questions, I would be happy to answer them.
Thanks for your attention.

Learn more about the Databricks Data and AI platform.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.