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

Expunging a deleted resource makes unnecessary database queries #5900

Closed
holly-smile opened this issue May 1, 2024 · 0 comments · Fixed by #5901
Closed

Expunging a deleted resource makes unnecessary database queries #5900

holly-smile opened this issue May 1, 2024 · 0 comments · Fixed by #5901
Assignees

Comments

@holly-smile
Copy link
Collaborator

Describe the bug
When $expunge requests are made with the expungeDeletedResources parameter set to true, we also call JpaResourceExpungeService.deleteAllSearchParams. However, search parameters should have already been deleted when the resource itself was deleted. This unnecessary query has lead to tangible performance issues.

To Reproduce

  1. Load some resources.
  2. Submit a DELETE request to mark some of the resources as deleted.
  3. POST an $expunge request with "expungeDeletedResources" parameter set to true.

The $expunge request results in a call to JpaResourceExpungeService.deleteAllSearchParams, as can be observed with a breakpoint.

Expected behavior
$expunge does not call JpaResourceExpungeService.deleteAllSearchParams.

Environment (please complete the following information):

  • HAPI FHIR Version: 7.3.0-SNAPSHOT
@holly-smile holly-smile self-assigned this May 1, 2024
tadgh pushed a commit that referenced this issue May 3, 2024
* Remove unnecessary call to deleteAllSearchParams. Fixes #5900.

* Regression test

* Run spotless
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 a pull request may close this issue.

1 participant