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

Improve search_events view definition #757

Open
Tracked by #1329
LukasKalbertodt opened this issue Mar 16, 2023 · 0 comments
Open
Tracked by #1329

Improve search_events view definition #757

LukasKalbertodt opened this issue Mar 16, 2023 · 0 comments
Labels
area:backend Everything backend related area:database The Tobira database kind:improvement

Comments

@LukasKalbertodt
Copy link
Member

Our current definition of the search_events view is not optimal in regards to performance. We have to use cases:

  • Fetching only a few specific events (e.g. done by tobira search-index update)
  • Fetching all events (e.g. done by tobira search-index rebuild)

The current definition is fast for fetching all events, but slow for only fetching a few. Well, it takes the exact same time in both cases, but that's the point: the "only few" should be much faster, scaling with the number of events we are looking up. That's because the current view definition always does a full scan of realms (due to the join).

An alternative method would be to have a nested query in the select as host_realms instead of the join. That's how search_series does it. Thats way faster for "only a few events" (scales appropriately), but is notably slower for "all events". It's also questionable whether it's maybe notably slower for search_series too, but we haven't noticed it bc there are fewer series?

In any case, it would be nice to find a query that combines the best of both worlds.

@LukasKalbertodt LukasKalbertodt added area:backend Everything backend related kind:improvement area:database The Tobira database labels Mar 16, 2023
@LukasKalbertodt LukasKalbertodt mentioned this issue Feb 4, 2025
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:backend Everything backend related area:database The Tobira database kind:improvement
Projects
None yet
Development

No branches or pull requests

1 participant