-
Notifications
You must be signed in to change notification settings - Fork 30
⚡ Bolt: Defer heavy columns in issue deduplication queries #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
⚡ Bolt: Defer heavy columns in issue deduplication queries #347
Conversation
Optimizes `create_issue` and `get_nearby_issues` endpoints by deferring the loading of `action_plan` (JSON text), `image_path`, and `location` columns. This prevents fetching large amounts of unused data during spatial deduplication and list retrieval, reducing memory usage and database I/O. Verified that deferred fields are not accessed in the response path, preventing N+1 query regressions. Co-authored-by: RohanExploit <178623867+RohanExploit@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
✅ Deploy Preview for fixmybharat canceled.
|
🙏 Thank you for your contribution, @RohanExploit!PR Details:
Quality Checklist:
Review Process:
Note: The maintainers will monitor code quality and ensure the overall project flow isn't broken. |
📝 WalkthroughWalkthroughOptimizes database queries in issue endpoints by adding SQLAlchemy deferred loading for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR optimizes issue “candidate list” queries used for deduplication and nearby-issues lookup by deferring loading of large/rarely-needed columns, reducing DB-to-app payload and memory usage during spatial filtering.
Changes:
- Deferred
Issue.action_plan,Issue.image_path, andIssue.locationwhen querying candidate open issues increate_issuededuplication logic. - Deferred the same columns in
get_nearby_issuesbounding-box candidate query.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
⚡ Performance Optimization
What:
Deferred
action_plan,image_path, andlocationcolumns increate_issue(deduplication logic) andget_nearby_issuesqueries.Why:
These endpoints fetch lists of issues to check for duplicates or display on a map. The
action_planfield is a large JSON blob stored as TEXT, andimage_pathcan be long. Fetching these for every candidate issue in a bounding box (even if filtered later by distance) wastes memory and DB bandwidth.Impact:
Verification:
descriptionwhich is not deferred).NearbyIssueResponseconstruction, ensuring no N+1 query regression.PR created automatically by Jules for task 4160832973954895673 started by @RohanExploit
Summary by CodeRabbit