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

Fix breadcrumbs and simplify realm SQL queries by using resolved_name #709

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

LukasKalbertodt
Copy link
Member

When this whole "derive name from blocks" thing was introduced, all queries have gotten three extra joins. A useful SQL function was also added that allows us to just write realms.resolved_name. The comment on that function mentions that doing the join manually is faster than using the function. After testing this again, I cannot confirm. Even just querying all realms and selecting resolved_name runs within 90ms (including network!). There seems to be on problem and certainly no N+1 problem.

Using that instead of the joins simplifies many queries. But more importantly, our breadcrumbs are now correct. Before, the JOINs messed up the guaranteed order of ancestors_of_realm. Now it should be fixed.

When this whole "derive name from blocks" thing was introduced, all
queries have gotten three extra joins. A useful SQL function was also
added that allows us to just write `realms.resolved_name`. The comment
on that function mentions that doing the join manually is faster than
using the function. After testing this again, I cannot confirm. Even
just querying all realms and selecting `resolved_name` runs within
90ms (including network!). There seems to be on problem and certainly
no N+1 problem.

Using that instead of the joins simplifies many queries. But more
importantly, our breadcrumbs are now correct. Before, the JOINs messed
up the guaranteed order of `ancestors_of_realm`. Now it should be fixed.
@LukasKalbertodt LukasKalbertodt added the changelog:user User facing changes label Feb 15, 2023
@github-actions github-actions bot temporarily deployed to test-deployment-pr709 February 15, 2023 17:01 Destroyed
Copy link
Member

@owi92 owi92 left a comment

Choose a reason for hiding this comment

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

Appears to be working 👍

@owi92 owi92 merged commit a0c134b into elan-ev:master Feb 16, 2023
@LukasKalbertodt LukasKalbertodt deleted the fix-breadcrumb-order branch February 16, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:user User facing changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants