Skip to content

Conversation

@anikdhabal
Copy link
Contributor

@anikdhabal anikdhabal commented Dec 5, 2025

What does this PR do?

Summary by cubic

Reduced database queries by batching operations and removing N+1 patterns across credential deletion, CRM event creation, and team availability. This lowers query count and improves performance under load.

  • Performance
    • handleDeleteCredential: use updateMany/deleteMany for bookings, payments, attendees, and booking references; delete payments by ID in a single pass.
    • createCRMEvent: parse apps, collect credential IDs, load credentials with one query, and reuse via a map per app.
    • listTeamAvailability: enrich user profiles in bulk and reuse results, avoiding per-membership lookups.

Written for commit 18bb66e. Summary will update automatically on new commits.

@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
cal-companion Ready Ready Preview Comment Dec 5, 2025 2:35pm
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Dec 5, 2025 2:35pm
cal-eu Ignored Ignored Dec 5, 2025 2:35pm

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

@ThyMinimalDev ThyMinimalDev self-requested a review December 8, 2025 12:32
@anikdhabal anikdhabal merged commit 161ebdb into main Dec 9, 2025
83 of 90 checks passed
@anikdhabal anikdhabal deleted the fix/optimize-n-plus-one-queries branch December 9, 2025 07:32
@anikdhabal anikdhabal changed the title perf: Fix N+1 queries and optimize database operations refactor: Fix N+1 queries and optimize database operations Dec 9, 2025
@ThyMinimalDev ThyMinimalDev restored the fix/optimize-n-plus-one-queries branch December 10, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants