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 speed of user list query #7466

Merged
merged 18 commits into from
Jan 22, 2024
Merged

Improve speed of user list query #7466

merged 18 commits into from
Jan 22, 2024

Conversation

frcroth
Copy link
Member

@frcroth frcroth commented Nov 29, 2023

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

For the two test users this results in about 30% faster requests for me.

Steps to test:

  • Functionality should be tested with automatic tests

TODOs:

  • Remove compact parameter as non-compact could be deleted.

Issues:


(Please delete unneeded items, merge only when none are left open)

app/models/user/User.scala Outdated Show resolved Hide resolved
@frcroth frcroth self-assigned this Dec 11, 2023
@frcroth frcroth requested a review from fm3 December 13, 2023 09:45
@frcroth frcroth marked this pull request as ready for review December 13, 2023 09:45
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

I think it would be good to get that isEditableBy logic into SQL after all. Maybe add some comments to ensure we keep those in sync in the future. But 1 or n queries for n users will make a bigger difference for a longer user list (I assume you didn’t have more than 10 users when testing?)

Also, could you make use of ARRAY_AGG and the parseArrayLiteral function that was introduced in #7479 ? (Also for the other recently added compact queries). Then we don’t have this nullable handling code with Option(x) distributed all over our codebase.

app/models/user/User.scala Outdated Show resolved Hide resolved
@frcroth frcroth requested a review from fm3 January 15, 2024 10:54
@frcroth frcroth requested a review from fm3 January 22, 2024 12:54
@frcroth frcroth merged commit c46194e into master Jan 22, 2024
2 checks passed
@frcroth frcroth deleted the faster-user-list branch January 22, 2024 16:17
@frcroth frcroth mentioned this pull request Jan 22, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Speed up user list request
2 participants