-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize approverRelation "OR" query
The "OR" REF query over multiple relations (specified by `approverRelation` property) was inefficient on some databases. (Especially for old generic repo, where multiple left joins were used in such cases.) It is now replaced by a set of independent queries, with the results merged afterwards. We assume that there will not be a large number of relations used, so the number of queries will be low. This resolves MID-8134.
- Loading branch information
Showing
6 changed files
with
181 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
model/workflow-impl/src/test/resources/miscellaneous/role-approved-by-multiple-relations.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- | ||
~ Copyright (C) 2010-2023 Evolveum and contributors | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
|
||
<role xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3" | ||
oid="62d7fcdf-92b0-4c49-ae40-33b0a814ed56"> | ||
<name>approved-by-multiple-relations</name> | ||
<assignment> | ||
<policyRule> | ||
<policyConstraints> | ||
<assignment> | ||
<operation>add</operation> | ||
</assignment> | ||
</policyConstraints> | ||
<policyActions> | ||
<approval> | ||
<approverRelation>org:approver</approverRelation> | ||
<approverRelation>org:owner</approverRelation> | ||
<approverRelation>org:test</approverRelation> | ||
</approval> | ||
</policyActions> | ||
</policyRule> | ||
</assignment> | ||
</role> |
18 changes: 18 additions & 0 deletions
18
model/workflow-impl/src/test/resources/miscellaneous/user-approver-by-multiple-relations.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- | ||
~ Copyright (C) 2010-2023 Evolveum and contributors | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
|
||
<user xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3" | ||
oid="a9aca7bb-923e-4be6-9aa4-5c90af978207"> | ||
<name>approver-by-multiple-relations</name> | ||
<assignment> | ||
<targetRef oid="62d7fcdf-92b0-4c49-ae40-33b0a814ed56" type="RoleType" relation="org:approver"/> | ||
</assignment> | ||
<assignment> | ||
<targetRef oid="62d7fcdf-92b0-4c49-ae40-33b0a814ed56" type="RoleType" relation="org:owner"/> | ||
</assignment> | ||
</user> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters