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

Ineffective implementation of can_request_help in permissionsView #1141

Open
zenovich opened this issue Aug 4, 2024 · 1 comment
Open

Ineffective implementation of can_request_help in permissionsView #1141

zenovich opened this issue Aug 4, 2024 · 1 comment
Assignees
Labels
Type: Maintenance Change required to improve the tech debt Type: Perf Performance improvement

Comments

@zenovich
Copy link
Collaborator

zenovich commented Aug 4, 2024

#1006 implemented changes described in #1004 by making a separate DB query getting values of can_request_help and then one DB query for each row with can_request_help to determine if the group name can be shown to the user. So, "N+1 selects problem".

We need to rework it.

Ideas:

  1. We could use JSON_ARRAYAGG to get values of can_request_help:
+------------------------------------+
| JSON_ARRAYAGG(can_request_help_to) |
+------------------------------------+
| [120505918794412400]               |
| [3, 3]                             |
| [3]                                |
+------------------------------------+
3 rows in set (0.00 sec)
  1. We could make just one query for all the groups at once to figure out if a group is visible or not.

  2. Probably we could even get all the info in just one query (a problem marked with a start 😉)

@zenovich zenovich added Type: Maintenance Change required to improve the tech debt Type: Perf Performance improvement labels Aug 4, 2024
@zenovich
Copy link
Collaborator Author

zenovich commented Aug 4, 2024

@smadbe, @GeoffreyHuck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Maintenance Change required to improve the tech debt Type: Perf Performance improvement
Projects
None yet
Development

No branches or pull requests

1 participant