-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[PM-21031] GET members performance optimization #5905
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
base: main
Are you sure you want to change the base?
Conversation
…UserUserDetailsQuery for optimized user detail retrieval
…mize user detail retrieval and enhance two-factor authentication and claimed status handling
…sersRecipe - Implemented methods to create collections and groups for organizations. - Added logic to associate users with randomly assigned groups and collections. - Enhanced bulk insertion of user associations for improved performance.
- Introduced GetManyDetailsByOrganizationOptimized_Projection method in both EF and Dapper repositories. - This method utilizes conditional loading for improved performance and functionality. - Added XML documentation to clarify usage and performance benefits. - Note: Dapper implementation throws a NotImplementedException as this optimization is specific to EF.
…ort query optimization - Updated Get and GetvNext methods in OrganizationUsersController to include a queryOptimization parameter for improved performance. - Modified OrganizationUserUserDetailsQuery to conditionally use optimized projection based on the new parameter. - Adjusted interface IOrganizationUserUserDetailsQuery to reflect the changes in method signatures. - Added performance tests to compare optimized and unoptimized query execution times, ensuring data consistency between both methods.
…ails - Introduced GetManyDetailsByOrganizationOptimized_SingleCall method in both Dapper and EF repositories. - This method utilizes a single database call with multiple result sets to enhance performance by reducing round trips to the database. - Added XML documentation to clarify usage and performance benefits of the new method.
…ails - Created OrganizationUserUserDetails_ReadByOrganizationIdOptimized stored procedure to fetch user details, group associations, and collection associations in a single call. - Supports conditional retrieval based on parameters for improved performance and reduced database round trips.
…ails - Implemented GetManyDetailsByOrganizationAsync_WithGroupsAndCollections test to validate the performance and correctness of the optimized retrieval method. - The test benchmarks the original and optimized query execution times, ensuring data consistency and logging results for performance improvements. - Added cleanup logic to remove test data after execution to maintain test integrity.
… user details retrieval - Changed the stored procedure name from OrganizationUserUserDetails_ReadByOrganizationIdOptimized to OrganizationUserUserDetails_WithGroupsCollections_ReadByOrganizationId to better reflect its functionality. - Updated the OrganizationUserRepository to call the renamed stored procedure, ensuring consistency in the method used for retrieving organization user details along with group and collection associations.
…formance - Renamed and updated repository methods to use GetManyDetailsByOrganizationAsync_vNext for optimized retrieval of organization user details. - Removed outdated optimized methods and updated XML documentation to reflect the new approach. - Added a new stored procedure to support the optimized retrieval of user details, groups, and collections in a single call. - Updated integration tests to validate the new method and ensure performance improvements.
Great job, no security vulnerabilities found in this Pull Request |
…optimization parameter - Updated Get and GetvNext methods in OrganizationUsersController and OrganizationUserUserDetailsQuery to eliminate the queryOptimization parameter, simplifying method signatures. - Adjusted related interface IOrganizationUserUserDetailsQuery to reflect the changes in method definitions. - Ensured consistent usage of optimized retrieval methods across the codebase.
…consistency - Renamed methods in IOrganizationUserRepository and their implementations to improve clarity, changing GetManyDetailsByOrganizationAsync_vNext to GetManyDetailsWithGroupsCollectionsByOrganizationAsync. - Updated XML documentation to reflect the new method names and their optimized retrieval strategies.
… and clarity - Updated repository methods to use GetManyDetailsByOrganizationAsync_vNext, enhancing performance by reducing database round trips. - Renamed and implemented a new stored procedure, OrganizationUserUserDetails_ReadByOrganizationId_V2, to support optimized retrieval of user details, groups, and collections in a single call. - Adjusted XML documentation to reflect the changes in method names and their optimized retrieval strategies.
- Introduced GetManyByOrganizationWithClaimedDomainsAsync_vNext method in IOrganizationUserRepository for improved performance. - Created a new stored procedure, OrganizationUser_ReadByOrganizationIdWithClaimedDomains_V2, to support the optimized retrieval. - Added a new query class, OrganizationUserReadByClaimedOrganizationDomainsQuery_vNext, to facilitate the new retrieval logic. - Updated XML documentation to reflect the new method and its performance enhancements.
- Updated OrganizationUsersControllerPerformanceTests to include a mock feature service for toggling optimization. - Adjusted test cases to benchmark both optimized and unoptimized retrieval methods, ensuring accurate performance comparisons. - Improved test output for clarity on performance improvements and data consistency checks.
- Added benchmarks to compare the original and optimized retrieval methods for organization users. - Implemented detailed assertions to verify data consistency between both methods. - Logged performance improvements and results for better visibility in test outputs.
- Introduced conditional logic in GetOrganizationUsersClaimedStatusQuery to utilize an optimized retrieval method based on feature flag. - Removed the obsolete OrganizationUserReadByClaimedOrganizationDomainsQuery_vNext class to streamline the codebase. - Updated OrganizationUserRepository to simplify the GetManyByOrganizationWithClaimedDomainsAsync_vNext method, ensuring it calls the existing method without unnecessary complexity.
…zation user retrieval - Created OrganizationUserUserDetails_ReadByOrganizationId_V2 to retrieve user details, groups, and collections based on organization ID. - Introduced OrganizationUser_ReadByOrganizationIdWithClaimedDomains_V2 to fetch users with verified domain claims for a given organization ID. - Enhanced query structure to improve performance and clarity in data retrieval.
…tion # Conflicts: # src/Core/Constants.cs # test/Api.IntegrationTest/AdminConsole/Controllers/OrganizationUsersControllerPerformanceTests.cs
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ac/pm-21031/optimize-get-members-endpoint-performance #5905 +/- ##
==========================================================================================
- Coverage 51.34% 12.11% -39.23%
==========================================================================================
Files 1702 1003 -699
Lines 75718 44463 -31255
Branches 6812 3513 -3299
==========================================================================================
- Hits 38877 5387 -33490
- Misses 35310 38973 +3663
+ Partials 1531 103 -1428 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…feature service - Updated OrganizationUsersControllerPerformanceTests to include a mock feature service that allows toggling of the MembersGetEndpointOptimization flag. - Improved test setup to ensure accurate performance comparisons between optimized and unoptimized retrieval methods. - Set client timeout to 5 minutes for better handling of long-running tests.
…ieval - Simplified the retrieval logic in OrganizationUsersController by directly returning the results from the query methods, reducing unnecessary variable declarations. - Enhanced code clarity and maintainability while preserving existing functionality for managing users and account recovery enrolled users.
…nd performance - Updated the method to utilize the optimized GetManyDetailsByOrganizationAsync_vNext for retrieving organization user details, enhancing performance. - Simplified the response structure by directly incorporating user permissions and two-factor authentication status into the result set. - Improved code readability by using descriptive variable names and reducing unnecessary complexity in the response generation logic.
…Domains that uses CTE for better performance
…_V2 for retrieving user details, group associations, and collection associations by organization ID.
…zationWithClaimedDomainsAsync_vNext in IOrganizationUserRepository to enhance performance by reducing database round trips.
…c_vNext to validate behavior with verified and unverified domains.
…into ac/pm-21031/get-members-performance-optimization
…stom user types in OrganizationUserUserDetailsQuery.
…into ac/pm-21031/get-members-performance-optimization
This update introduces the creation of sample custom permissions for OrganizationUser types in the OrganizationWithUsersRecipe. It implements a user type distribution strategy to test optimization, assigning permissions only to Custom users while varying user types among Admin, User, and Owner. This change aims to enhance performance by ensuring that permissions are processed efficiently based on user type.
…rformance # Conflicts: # src/Core/Constants.cs
…that uses UserEmailDomainView to fetch Email domains
…pository and its implementations
…tored procedure to use UserEmailDomainView for email domain extraction, improving query efficiency and clarity.
…etManyDetailsByOrganizationAsync method, clarifying its purpose and performance optimizations. Added remarks for better understanding of its functionality.
…Domain_V2.sql to adhere to coding standards.
…into ac/pm-21031/get-members-performance-optimization
…domains for user creation.
…ganization domains, collections, and groups with domain distribution and optimized user types.
…use CTE and add indexes
…into ac/pm-21031/get-members-performance-optimization
…d related migration script adjustments
…into ac/pm-21031/get-members-performance-optimization
|
🎟️ Tracking
📔 Objective
📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes