diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_1_0/3714-improve-chained-search-performance.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_1_0/3714-improve-chained-search-performance.yaml new file mode 100644 index 00000000000..18e792d33e6 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_1_0/3714-improve-chained-search-performance.yaml @@ -0,0 +1,4 @@ +type: perf +issue: 3714 +jira: SMILE-4484 +title: "Chained searches have been sped up for configurations where the `Index Contained Resources` feature is enabled." diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java index e44556518be..4c8b1363b06 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/builder/QueryStack.java @@ -933,7 +933,7 @@ public class QueryStack { EnumSet cachedReusePredicateBuilderTypes = EnumSet.copyOf(myReusePredicateBuilderTypes); myReusePredicateBuilderTypes.clear(); - UnionQuery union = new UnionQuery(SetOperationQuery.Type.UNION); + UnionQuery union = new UnionQuery(SetOperationQuery.Type.UNION_ALL); ReferenceChainExtractor chainExtractor = new ReferenceChainExtractor(); chainExtractor.deriveChains(theResourceName, theSearchParam, theList);