Skip to content

perf: optimize active bookings query in BookingRepository#28073

Open
deepshekhardas wants to merge 1 commit intocalcom:mainfrom
deepshekhardas:perf/booking-repository-optimization
Open

perf: optimize active bookings query in BookingRepository#28073
deepshekhardas wants to merge 1 commit intocalcom:mainfrom
deepshekhardas:perf/booking-repository-optimization

Conversation

@deepshekhardas
Copy link

Optimizes the active bookings query for Round Robin by splitting complex OR conditions into parallel index-friendly queries.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Feb 19, 2026
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 2 files

@deepshekhardas
Copy link
Author

Hi team 👋, friendly bump on this PR. I'd love to get this reviewed when you have a moment. Happy to make any changes if needed. Thanks!

@deepshekhardas
Copy link
Author

Hi team, friendly bump on this PR. Happy to make any changes if needed. Thanks!

@deepshekhardas deepshekhardas force-pushed the perf/booking-repository-optimization branch from 7180742 to 7caccd2 Compare February 23, 2026 04:32
- Split the complex OR query in getAllBookingsForRoundRobin into two parallel, index-friendly findMany calls
- Avoids potential full table scans by filtering separately by userId (host) and attendees email
- Merges results in-memory and deduplicates by ID
- Improves query performance for large datasets
@deepshekhardas deepshekhardas force-pushed the perf/booking-repository-optimization branch from 7caccd2 to 413c700 Compare February 23, 2026 05:12
@deepshekhardas
Copy link
Author

Hi team! I've cleaned up this PR. It now only contains the core performance optimization for BookingRepository.ts (1 file). Rebased and ready for review. Thanks!

@deepshekhardas deepshekhardas force-pushed the perf/booking-repository-optimization branch from d6bdcff to 413c700 Compare February 28, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Created by Linear-GitHub Sync size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant