Repository navigation
Avoid multiplying trigger and occurrence rows in the Events list - #440
Merged
Merged
Conversation
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.
Change
Aggregate trigger counts and occurrence counts independently within the active workspace before joining the current event definitions. Retain ordering, historical occurrences, disabled triggers, and zeros. No UI, endpoint, schema, or visibility changes.
Verification
GET /api/v1/eventscovers multiple child rows, zero and one-sided counts, historical revisions, order, and the same Event UUID in two workspaces.EXPLAIN (ANALYZE, BUFFERS)on a skewed synthetic fixture (4 workspaces; 40 definitions, 108 triggers and 41,700 occurrences per workspace) returned identical data. The prior plan joined 923,400 rows before grouping and spilled to temp storage. The new plan aggregated the two independent child inputs and did not spill. Median across five alternating runs after warm-up: 4,660 ms before, 23 ms after. Not a production measurement.npm testattempted. Local Chromium reported target crashes, and Wrangler's local runtime is limited by the sandbox (uv_interface_addresses). CI should independently verify these lanes.