Add event meter join table / materialization#8790
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
71e4663 to
69685b4
Compare
986d319 to
fea3c56
Compare
This was referenced Jan 7, 2026
3ed025f to
f617a62
Compare
… table We introduce the ability to ecompare billing entries fetched via meter_events with the previous functionality. This allows us to roll this out as a comparison initially. The ambition is that this will eliminate the expensive JSONB filter evaluation that was causing 703 second query times on large datasets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
f617a62 to
5894053
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a meter_events join table that joins meters with events that matches their filter. This will save us the need to find events via the complex matching logic, and instead we can do a simple select for the events that match. Initially only for
create_billing_entries, but I believe we will be able to use this in the other tasks where we are querying events that match a meter definition.I'll split this into three PRs if we think this makes sense.
Open questions:
Do we need to backfill the link between events and meters if a new meter is created? Or is it fine to only be forward lookingDo we need to backfill or remove the link if a meter is updated?