Skip to content

Optimize allocator report details query - #265

Open
lukasz-wal wants to merge 1 commit into
mainfrom
ref/optimize-report-queries
Open

Optimize allocator report details query#265
lukasz-wal wants to merge 1 commit into
mainfrom
ref/optimize-report-queries

Conversation

@lukasz-wal

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI lite review requested due to automatic review settings August 25, 2026 12:35
@lukasz-wal
lukasz-wal deployed to production-fidl August 25, 2026 12:39 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");
Comment thread prisma/sql/getAllocatorReportChecksDetails.sql Outdated
@lukasz-wal
lukasz-wal force-pushed the ref/optimize-report-queries branch from dcac1cd to 3533959 Compare August 25, 2026 12:46
@lukasz-wal
lukasz-wal force-pushed the ref/optimize-report-queries branch from 3533959 to a781060 Compare August 25, 2026 12:53
@lukasz-wal
lukasz-wal deployed to production-fidl August 25, 2026 12:56 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants