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

Get one fbt query perf #1464

Merged
merged 2 commits into from
Feb 4, 2025
Merged

Get one fbt query perf #1464

merged 2 commits into from
Feb 4, 2025

Conversation

Veikkosuhonen
Copy link
Member

Fixes slow performance when fetching /api/feedback-targets/:id.

This is critical because the endpoint could sometimes be so slow it timed out and returned an error view to the user.

This was caused by changes in #1428 , there was an expensive join to summaries by feedback_target_id without an index.

In addition, joining user_feedback_targets in a single query was expensive.

Tested on a local machine with a fbt with around 150/200 feedbacks:

Before: 4000 ms

Adding an index: 800 ms

Separate query for ufbts: 100 ms

@Veikkosuhonen Veikkosuhonen added bug norppa is broken optimisation Programmers need to make everything blazingly fast labels Jan 31, 2025
@Veikkosuhonen Veikkosuhonen self-assigned this Jan 31, 2025
@Veikkosuhonen Veikkosuhonen merged commit 7ad7315 into master Feb 4, 2025
37 checks passed
@Veikkosuhonen Veikkosuhonen deleted the get-one-fbt-query-perf branch February 6, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug norppa is broken optimisation Programmers need to make everything blazingly fast
Projects
Status: Waiting for QA
Development

Successfully merging this pull request may close these issues.

1 participant