Improve performance of ResourceSearchView (use hfj_resource res_id instead of hfj_res_ver res_id when querying by resource pids) (#4716)

* Improve performance of ResourceSearchView (use hfj_resource res_id instead of hfj_res_ver res_id when querying by resource pids)

* Add changelog and credit

---------

Co-authored-by: Primož Delopst <primoz.delopst@better.care>
Co-authored-by: James Agnew <jamesagnew@gmail.com>
This commit is contained in:
Primož Delopst 2023-04-04 20:30:28 +02:00 committed by GitHub
parent fa00ef23e2
commit 49a39c195c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,6 @@
---
type: perf
issue: 4716
title: "The SQL query used to fetch pages of search results resulted in an inefficient use
of the database in cases where resources have many different versions stored. Thanks to
Primož Delopst for the pull request!"

View File

@ -46,7 +46,7 @@ import java.util.Date;
@Entity @Entity
@Immutable @Immutable
@Subselect("SELECT h.pid as pid, " + @Subselect("SELECT h.pid as pid, " +
" h.res_id as res_id, " + " r.res_id as res_id, " +
" h.res_type as res_type, " + " h.res_type as res_type, " +
" h.res_version as res_version, " + // FHIR version " h.res_version as res_version, " + // FHIR version
" h.res_ver as res_ver, " + // resource version " h.res_ver as res_ver, " + // resource version

View File

@ -859,6 +859,10 @@
<developer> <developer>
<id>JorisHeadease</id> <id>JorisHeadease</id>
</developer> </developer>
<developer>
<id>delopst</id>
<name>Primož Delopst</name>
</developer>
</developers> </developers>
<licenses> <licenses>