Skip to content
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

Annotate incident list with user group info on related acks #843

Open
podliashanyk opened this issue Jul 5, 2024 · 0 comments
Open

Annotate incident list with user group info on related acks #843

podliashanyk opened this issue Jul 5, 2024 · 0 comments
Labels
optimization Something is too slow/takes too much memory polish Nice to have

Comments

@podliashanyk
Copy link
Contributor

podliashanyk commented Jul 5, 2024

As suggested by @lunkwill42 in #838:

But I guess the bigger question here is whether you will be calling this method repeatedly for a bunch of incidents in a table - that will be very inefficient.

That's when you might consider some sort of addition to IncidentQuerySet that pre-annotates the resulting Incident objects with acks-by-group from a single query.

Originally posted by @lunkwill42 in #838 (comment)

I'm sure @hmpf is much more on top of this than me, but besides looking at the Django docs, I believe this gives a nice overview: https://medium.com/@singhgautam7/django-annotations-steroids-to-your-querysets-766231f0823a

Originally posted by @lunkwill42 in #838 (comment)

Alternative suggestion was to add a new property in incident. By @elfjes in #838:

another option could be to have a property, say Incident.ack_groups that returns a set[str] with non-expired ack-groupnames. You could then do a simple in/__contains__ check if you want to check against a specific group. Still best to prefetch the acks though

Originally posted by @elfjes in #838 (comment)

@podliashanyk podliashanyk added polish Nice to have optimization Something is too slow/takes too much memory labels Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Something is too slow/takes too much memory polish Nice to have
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant