diff --git a/backend/src/main/java/com/bakdata/conquery/apiv1/query/SecondaryIdQuery.java b/backend/src/main/java/com/bakdata/conquery/apiv1/query/SecondaryIdQuery.java index 72cae95541..03184e4ba0 100644 --- a/backend/src/main/java/com/bakdata/conquery/apiv1/query/SecondaryIdQuery.java +++ b/backend/src/main/java/com/bakdata/conquery/apiv1/query/SecondaryIdQuery.java @@ -67,7 +67,7 @@ public class SecondaryIdQuery extends Query { @Override public SecondaryIdQueryPlan createQueryPlan(QueryPlanContext context) { - return new SecondaryIdQueryPlan(query, context, secondaryId, withSecondaryId, withoutSecondaryId); + return new SecondaryIdQueryPlan(query, context, secondaryId, withSecondaryId, withoutSecondaryId, query.createQueryPlan(context.withSelectedSecondaryId(secondaryId))); } @Override diff --git a/backend/src/main/java/com/bakdata/conquery/models/query/queryplan/SecondaryIdQueryPlan.java b/backend/src/main/java/com/bakdata/conquery/models/query/queryplan/SecondaryIdQueryPlan.java index 855f17f869..37f6a71e7b 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/query/queryplan/SecondaryIdQueryPlan.java +++ b/backend/src/main/java/com/bakdata/conquery/models/query/queryplan/SecondaryIdQueryPlan.java @@ -51,9 +51,11 @@ public class SecondaryIdQueryPlan implements QueryPlan { private final Set tablesWithSecondaryId; private final Set tablesWithoutSecondaryId; + private final ConceptQueryPlan queryPlan; + + private final Map childPerKey = new HashMap<>(); - private ConceptQueryPlan queryPlan; /** @@ -113,7 +115,6 @@ private Optional createResult(Entity entity) { @Override public void init(QueryExecutionContext ctx, Entity entity) { - queryPlan = query.createQueryPlan(queryPlanContext.withSelectedSecondaryId(secondaryId)); queryPlan.init(ctx, entity);