Remove unnecessary type predicate (#1963)
* Remove unnecessary type predicate * Add changelog
This commit is contained in:
parent
e23e222f80
commit
290577ff3e
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
type: perf
|
||||||
|
issue: 1963
|
||||||
|
title: "When performing a search in the JPA server using a chained search parameter, an unnecessary resource type predicate
|
||||||
|
was previously added to the generated SQL and has now been removed. This should improve performance on some queries."
|
|
@ -354,7 +354,7 @@ class PredicateBuilderReference extends BasePredicateBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
Predicate predicate = myCriteriaBuilder.or(toArray(theCodePredicates));
|
Predicate predicate = myCriteriaBuilder.or(toArray(theCodePredicates));
|
||||||
myQueryStack.addPredicate(predicate);
|
myQueryStack.addPredicateWithImplicitTypeSelection(predicate);
|
||||||
return predicate;
|
return predicate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -403,13 +403,16 @@ public class FhirResourceDaoR4SearchNoFtTest extends BaseJpaR4Test {
|
||||||
List<String> ids;
|
List<String> ids;
|
||||||
SearchParameterMap map;
|
SearchParameterMap map;
|
||||||
IBundleProvider results;
|
IBundleProvider results;
|
||||||
|
String searchSql;
|
||||||
|
|
||||||
map = new SearchParameterMap();
|
map = new SearchParameterMap();
|
||||||
map.setLoadSynchronous(true);
|
map.setLoadSynchronous(true);
|
||||||
map.add(Encounter.SP_SUBJECT, new ReferenceParam("subject", "foo|bar").setChain("identifier"));
|
map.add(Encounter.SP_SUBJECT, new ReferenceParam("subject", "foo|bar").setChain("identifier"));
|
||||||
myCaptureQueriesListener.clear();
|
myCaptureQueriesListener.clear();
|
||||||
results = myEncounterDao.search(map);
|
results = myEncounterDao.search(map);
|
||||||
myCaptureQueriesListener.logSelectQueriesForCurrentThread(0);
|
searchSql = myCaptureQueriesListener.logSelectQueriesForCurrentThread(0);
|
||||||
|
assertEquals(0, StringUtils.countMatches(searchSql, "RES_DELETED_AT"));
|
||||||
|
assertEquals(0, StringUtils.countMatches(searchSql, "RES_TYPE"));
|
||||||
ids = toUnqualifiedVersionlessIdValues(results);
|
ids = toUnqualifiedVersionlessIdValues(results);
|
||||||
assertThat(ids, hasItems(enc1Id, enc2Id));
|
assertThat(ids, hasItems(enc1Id, enc2Id));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue