Optimize allocator report details query - #265
Open
lukasz-wal wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Optimizes allocator report detail queries with range-based filtering, shared history aggregation, and supporting indexes.
Changes:
- Refactors historical check aggregation and daily filtering.
- Declares supporting Prisma indexes.
- Adds a migration to create the indexes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Summary |
|---|---|
prisma/sql/getAllocatorReportChecksDetails.sql |
Query optimization added; historical aggregation should be restricted to requested allocator/check pairs. |
prisma/schema.prisma |
Adds supporting indexes. |
prisma/migrations/20260825141338_optimize_report_queries/migration.sql |
Adds indexes, but regular creation may block ingestion writes; use online indexing or a maintenance window. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1
to
+2
| CREATE INDEX IF NOT EXISTS "client_allocator_distribution_weekly_allocator_week_idx" | ||
| ON "client_allocator_distribution_weekly" ("allocator", "week"); |
lukasz-wal
force-pushed
the
ref/optimize-report-queries
branch
from
August 25, 2026 12:46
dcac1cd to
3533959
Compare
lukasz-wal
force-pushed
the
ref/optimize-report-queries
branch
from
August 25, 2026 12:53
3533959 to
a781060
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.
No description provided.