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

chore: remove nameInsensitive sorting on /v1/users.listByStatus #33401

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

ricardogarim
Copy link
Contributor

@ricardogarim ricardogarim commented Sep 30, 2024

This PR addresses an issue found during OPI-36, which focuses on identifying potential index improvements. We discovered that the nameInsensitive sort property used in the findPaginatedUsersByStatus function (responsible for listing users on the admin page) does not exist. As a result, MongoDB was forced to scan the entire dataset during sorting.

After resolving this, MongoDB's performance improved significantly, reducing query time from 23 seconds to 3 seconds for 500k users on the dev-benchmark database. Below are the explain results for reference.

MongoDB query explain - images

Before

image
image

After

image
image


Detailed explain JSON outputs can be found here.

Copy link
Contributor

dionisio-bot bot commented Sep 30, 2024

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Sep 30, 2024

⚠️ No Changeset found

Latest commit: e7cc92d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ricardogarim ricardogarim added this to the 7.0 milestone Sep 30, 2024
@ricardogarim ricardogarim requested review from a team September 30, 2024 11:58
@ricardogarim ricardogarim marked this pull request as ready for review September 30, 2024 11:58
Copy link
Contributor

github-actions bot commented Sep 30, 2024

PR Preview Action v1.4.8
Preview removed because the pull request was closed.
2024-10-14 19:44 UTC

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.35%. Comparing base (bc1e6ee) to head (e7cc92d).
Report is 54 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #33401   +/-   ##
========================================
  Coverage    58.35%   58.35%           
========================================
  Files         2692     2692           
  Lines        65265    65265           
  Branches     14730    14730           
========================================
  Hits         38084    38084           
  Misses       24403    24403           
  Partials      2778     2778           
Flag Coverage Δ
unit 75.32% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@sampaiodiego sampaiodiego added the stat: QA assured Means it has been tested and approved by a company insider label Oct 14, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 14, 2024
@sampaiodiego sampaiodiego modified the milestones: 7.0, 6.14 Oct 14, 2024
@sampaiodiego sampaiodiego merged commit 8c8238e into develop Oct 14, 2024
53 checks passed
@sampaiodiego sampaiodiego deleted the chore/remove-nameinsensitive-sorting branch October 14, 2024 19:41
@sampaiodiego sampaiodiego changed the title chore: remove nameInsensitive sorting chore: remove nameInsensitive sorting on /v1/users.listByStatus Oct 14, 2024
gabriellsh added a commit that referenced this pull request Oct 15, 2024
…ctor/avatar

* 'develop' of github.com:RocketChat/Rocket.Chat: (58 commits)
  refactor: unified users page header content into a single component (#33498)
  chore: store contact emails and phones on the same format as user's and visitor's (#33484)
  fix: broken jump-to-thread-message functionality using link  (#33332)
  feat: Apps-Engine method for reading and counting unread room messages for a user (#32194)
  feat: adds a new featured room action on the header for non-default category (#33562)
  chore(deps): bump actions/setup-node from 4.0.3 to 4.0.4 (#33327)
  fix: consider query strings in Twilio request validation (#33364)
  ci: add restore cache for `deploy-preview` (#33579)
  feat: add history endpoint (#33349)
  ci: cache artifacts to reduce api calls (#33567)
  feat: new E2EE composer hint (#33283)
  chore: Add `force` option to `rmSync` call (#33570)
  chore: remove nameInsensitive sorting on /v1/users.listByStatus (#33401)
  chore: Use `rmSync` instead of `rmdirSync` (#33551)
  feat: add contact channels (#33308)
  chore: split ImportDataConverter into multiple classes and add unit testing (#33394)
  test: added MockedDeviceContext to voip unit tests (#33553)
  refactor: adjusted voip endpoints error messages (#33515)
  fix: Cannot send messages after E2EE keys are refreshed (#33527)
  fix: Custom sounds not working when storage is set to filesystem (#33424)
  ...
@ggazzo ggazzo modified the milestones: 6.14, 7.0 Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants