Skip to content

Conversation

@saponifi3d
Copy link
Contributor

Description

We select workflows from the DB very frequently. This has added substantial load to our DB, even though the query is very fast / efficient.

This PR introduces a caching layer for this high frequency db query.

…che if a relationship to the detector or environment changes.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 23, 2026

if workflows is None:
environment_filter = (
(Q(environment_id=None) | Q(environment_id=environment.id))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 -- this line from the original query will likely cause our cache size to be a lot larger than needed. we could normalize this by having the "env filter = None" results as 1 cached query, and by environment as another.

Would like to see the impact of this / the size of the cache before diving into changing functionality of this query though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants