perf(db): rate-limit upsert, image index, rag alias warmup - #1547
Conversation
Rewrite consume_api_*_rate_limit to upsert, add a searchable document_images composite index, warm rag_aliases at boot with a longer TTL, and cache durable rate-limit denials only (never allows).
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 5 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
Comment |
|
Updates to Preview Branch (cursor/db-query-perf-eb0f) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
🔒 Upgrade RequiredPrivate repository analysis requires Pro or Enterprise. Upgrade: https://ecc.tools/pricing?plan=pro ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
🔒 Upgrade RequiredPrivate repository analysis requires Pro or Enterprise. Upgrade: https://ecc.tools/pricing?plan=pro ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers. |
🔒 Upgrade RequiredPrivate repository analysis requires Pro or Enterprise. Upgrade: https://ecc.tools/pricing?plan=pro ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers. |
Summary
consume_api_subject_rate_limit/consume_api_rate_limitto a singleINSERT … ON CONFLICTupsert (hosted apply still needs explicit approval).document_images_searchable_doc_page_relevance_idxfor the hydration filter/order pattern.rag_aliasesat production boot viainstrumentation.register(), and raise the in-memory TTL from 60s to 300s.p95(span.duration)/span.op:db> 500ms could not be created from this environment (no Sentry UI session / create-alert MCP tool). Manual step documented below.RAG impact: no retrieval behaviour change — alias cache TTL/warmup and hydration index only; ranking/selection/comparator paths untouched.
Verification
npm run verify:pr-local(lint, typecheck, full unit suite, production build, client-bundle scan, offline RAG fixtures — passed)848passedtests/api-rate-limit-fallback.test.ts,tests/rag-alias-cache-warmup.test.ts,tests/supabase-schema.test.ts— 92 passednpm run check:migration-rolenpm run drift:manifest(containerd overlay mount failure in this VM);schema_sha256updated offline — regenerate snapshot when Docker worksRisk and rollout
Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
Manual Sentry alert (blocked here):
p95(span.duration), filterspan.op:db, environmentproductionAfter merge, apply
supabase/migrations/20260731150000_db_query_perf_rate_limit_and_image_indexes.sqlto hosted Supabase with explicit approval, thennpm run drift:manifest.