Streaming pivot export

Jonathan Swenson · Friday Demos · July 3, 2025 · 3:05

We made it so pivots now also stream for exports, meaning no limit even for pivoted queries for downloads.

Try it yourselfThe full week on docsdownloadsexport

Transcript

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

  1. I'm going to say it. Any more questions for Kathy there first? All righty. Um, this is a little one. Um, I decided to try to take a little stab at seeing what happens if you go, you've got this nice data set. It's really, really descriptive. It um, ID pivoted by created year. It's going to be looking really sparse.

  2. Um, but one thing that really, you know, was bugging me is that I couldn't do this. Download all possible results. Um, I'm not actually sure how long this is going to take. That was pretty quick. Um, anyway, now I have a nice uh 2.5 megabyte CSV file with many more than 50,000 rows in it. That is all.

  3. What is the limit now? The limit does not exist. Um we still have column limits. Um we still like we we don't have any other plumbing to remove column limits but um pivot column limits but the um number of rows is unlimited there. We still have to come in and download other formats. Like I don't even think you can do it pivoted JSON download yet.

  4. And uh like there's some there's definitely some oddities with Excel but um because we can't do limited yet. But basically what took the um and basically had to massage the um the pivot to allow for a streaming pivot. Um, in particular, um, in order to get the pivot headers correct, um, we need to do a pivot with a totals query.

  5. Of course, you didn't ask for I didn't ask for a totals query there. Um, but basically what that does is it gives us the the totals, which is a set of rows that in there's one for each row or one for each pivot column rather that has a value so that we can basically figure out all the pivot columns.

  6. basically rip through that, get the headers, dump that up and then stream through the rest of the results instead of having to have the entire results in memory and unpivoting or rather pivoting out each row. We then can just rip through and for one row at a time and producers those are expensive queries. they are very large if you've got lots of um in particular like that the case that I just showed there like I actually only have one row per pivot row um which made it a fast and but that's also like with the the dummy data I had there I didn't have a great way to make a large data set like that um but you end up like these are large result

  7. sets we have a lot of data to process but we can rip through them now without having to blow them fully into memory