Always where filters plus better caching

TJ Banghart · Friday Demos · April 4, 2025 · 2:12

We added always\_where\_filter (a forced, hidden topic filter) alongside sql\_always\_where. Also some additional work to improve cache hit rates.

Try it yourselfThe full week on docscachingmodeling

Transcript

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

  1. Cool. All right, I will jump in. Uh I have a like two small things. Um first is looking at a topic. You can now have an always wear filter. So this is very similar to like always wear SQL except instead of using a SQL expression you use a filter. Here's a query. you can see that the wear is applied um but there's no filter control so it's always going to be applied um that's the first thing second thing is a kind of a heinous caching bug um that was reported by a customer I think like two weeks ago you can see I have this relationship in this topic um it's a normal user ID user ID uh equality and then an and based on a

  2. filter so you want the join condition to have the filter applied to it Um, and this is with the the fix reverted. So, you know, I'm filtering on seven years ago. Let's see like 700 years ago. Okay, that's pretty large filter range. Uh-oh. Cash hit. Doesn't matter what I put in here. That filter condition is not doing anything.

  3. Oh, shoot. Hey. Oh, okay. Hold on a second. Demo messed up. Oh, no. Trust me, it wasn't working. Yeah, cache hit. If you have actual filter values, it's going to be a hit every time. Maybe not. Okay, don't look at that. It wasn't working. And now if you actually like apply a filter, it should not get a cache hit.

  4. I think I'm in the wrong environment. Well, it's fixed, but it wasn't before. like it didn't matter what filter condition you had on the on the join, it would always be a cache hit. So you could have, you know, you could change the filter to whatever results don't change. Um, and that wasn't a good experience. So that's fixed.

  5. Demo did not go as planned, but that's okay.