Skip to content

add cached count fields to avoid expensive COUNT queries#757

Merged
furlongm merged 7 commits intomainfrom
sql-optimizations
Feb 13, 2026
Merged

add cached count fields to avoid expensive COUNT queries#757
furlongm merged 7 commits intomainfrom
sql-optimizations

Conversation

@furlongm
Copy link
Owner

  • Add sec_updates_count, bug_updates_count, packages_count, errata_count to Host
  • Add packages_count to Mirror
  • Add hosts_count to OSVariant
  • Add Django signals to auto-update counts on M2M/FK changes
  • Update views to use cached fields instead of annotations

- Add sec_updates_count, bug_updates_count, packages_count, errata_count to Host
- Add packages_count to Mirror
- Add hosts_count to OSVariant
- Add Django signals to auto-update counts on M2M/FK changes
- Update views to use cached fields instead of annotations
Copy link
Contributor

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Some things to consider. View full project report here.

Copy link
Contributor

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Some food for thought. View full project report here.

Copy link
Contributor

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Looks good. Worth considering though. View full project report here.

Copy link
Contributor

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Worth considering. View full project report here.

Copy link
Contributor

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Worth considering. View full project report here.

@furlongm furlongm merged commit 7b95a51 into main Feb 13, 2026
4 checks passed
@furlongm furlongm deleted the sql-optimizations branch February 13, 2026 14:44
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.

1 participant

Comments