Skip to content

perf: optimize unread notification count query#210

Open
Ayush-0918 wants to merge 2 commits into
nensii21:mainfrom
Ayush-0918:optimize-notification-queries
Open

perf: optimize unread notification count query#210
Ayush-0918 wants to merge 2 commits into
nensii21:mainfrom
Ayush-0918:optimize-notification-queries

Conversation

@Ayush-0918

Copy link
Copy Markdown
Contributor

Pull Request

Summary

Optimized the unread notification count by replacing the previous implementation, which loaded unread notifications into memory, with a SQL COUNT(*) query for better performance.


Related Issue

Closes #199


Type of Change

  • Performance improvement

Changes Made

  • Replaced the unread notification query with SELECT COUNT(*).
  • Used SQLAlchemy func.count() instead of loading all unread notification objects.
  • Preserved existing behavior while reducing unnecessary database load.

Screenshots (if applicable)

N/A


Testing

  • Tested locally
  • Existing tests pass
  • Added new tests
  • UI verified
  • Cross-browser tested (if applicable)

Additional testing notes:

  • Verified the query logic after replacing object loading with SQL COUNT(*).

Checklist

  • My code follows the project's coding standards.
  • I have tested my changes locally.
  • I have updated the documentation where necessary.
  • My changes do not introduce new warnings or errors.
  • I have reviewed my own code.
  • This pull request focuses on a single feature or fix.
  • I have linked the related issue.

Additional Notes

This change only optimizes the unread notification count query. No functional behavior has been modified.

@github-actions github-actions Bot 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.

🎉 Thank you for your first Pull Request to DevLink!

We appreciate your contribution to our open-source community.

Before your PR is reviewed, please ensure:

  • ✅ The project builds successfully.
  • ✅ Your code follows the project's coding standards.
  • ✅ You have tested your changes.
  • ✅ Related documentation has been updated if necessary.

Our maintainers will review your PR as soon as possible.

Thank you for helping improve DevLink! 💙

@nensii21

nensii21 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

attached videos and screenshots showing what changes have been made also some CI jobs are failing update it.

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.

Optimize Notification Queries

2 participants