New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse joins for jurisdiction predicates [5] #8688
Labels
backend
Affects the web backend
change
A change of an existing feature (ticket type)
performance
Issues that are meant to increase the performance of the application
refactoring
Technical refactoring of an existing feature
Milestone
Comments
StefanKock
added
backend
Affects the web backend
change
A change of an existing feature (ticket type)
performance
Issues that are meant to increase the performance of the application
labels
Apr 5, 2022
StefanKock
added this to Backlog
in SORMAS Team 2 - DEV - Iteration Backlog
via automation
Apr 5, 2022
2 tasks
StefanKock
added a commit
that referenced
this issue
Apr 5, 2022
StefanKock
moved this from Backlog
to Waiting
in SORMAS Team 2 - DEV - Iteration Backlog
Apr 5, 2022
StefanKock
changed the title
Reuse joins for jurisdiction checks
Reuse joins for jurisdiction predicates and filters
Apr 5, 2022
This was referenced Apr 7, 2022
StefanKock
changed the title
Reuse joins for jurisdiction predicates and filters
Reuse joins for jurisdiction predicates
Apr 7, 2022
This was referenced Apr 7, 2022
Waiting for #8748 to be merged. |
StefanKock
added a commit
that referenced
this issue
Apr 8, 2022
StefanKock
added a commit
that referenced
this issue
Apr 8, 2022
Paths: 1. Task - Case - Person - Location 2. Task - Contact - Case - ...
StefanKock
added a commit
that referenced
this issue
Apr 8, 2022
@BarnaBartha I started the work for this ticket on branch https://github.com/hzi-braunschweig/SORMAS-Project/tree/feature-8688_reuse_joins_for_jurisdiction_checks for you to pick it up. |
StefanKock
moved this from Waiting
to Backlog
in SORMAS Team 2 - DEV - Iteration Backlog
Apr 8, 2022
BarnaBartha
moved this from Backlog
to In Progress
in SORMAS Team 2 - DEV - Iteration Backlog
Apr 8, 2022
BarnaBartha
added a commit
that referenced
this issue
Apr 8, 2022
vidi42
changed the title
Reuse joins for jurisdiction predicates
Reuse joins for jurisdiction predicates [5]
Apr 11, 2022
BarnaBartha
added a commit
that referenced
this issue
Apr 11, 2022
…text where root of query is not EventParticipant
BarnaBartha
added a commit
that referenced
this issue
Apr 11, 2022
…ry is not Event - clean up all remaining QueryJoins
BarnaBartha
added a commit
that referenced
this issue
Apr 12, 2022
BarnaBartha
moved this from In Progress
to Review
in SORMAS Team 2 - DEV - Iteration Backlog
Apr 12, 2022
BarnaBartha
moved this from Review
to Waiting
in SORMAS Team 2 - DEV - Iteration Backlog
Apr 19, 2022
BarnaBartha
added a commit
that referenced
this issue
Apr 19, 2022
StefanKock
added a commit
that referenced
this issue
Apr 19, 2022
StefanKock
added a commit
that referenced
this issue
Apr 19, 2022
StefanKock
added a commit
that referenced
this issue
Apr 19, 2022
StefanKock
added a commit
that referenced
this issue
Apr 19, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend
Affects the web backend
change
A change of an existing feature (ticket type)
performance
Issues that are meant to increase the performance of the application
refactoring
Technical refactoring of an existing feature
Problem Description
Coming from investigation in #8637: When calling
"Entity"Service.inJurisdictionOrOwned
from other contexts, there should be a reusage of joins to drastically reduce LEFT JOINS for exampleTask -> Contact -> Case
Proposed Change
Task
,Sample
QueryJoins
object on the caller side (Task -> Case
) and not on the called side.QueryJoins
.Join
outside it's domain for all queries that create jurisdiction Predicates.Out of scope: Join reuse in createUserFilter methods -> #8747
Possible Alternatives
Additional Information
In the PoC I managed to get rid of 4 Case joins.
Before/After SQL comparison
Before:
After:
When I look at the needed changes, I get the impression that a massive overhaul is needed:
"Entity"QueryContext
needs to be checked and all or most to be edited."Entity"Joins
object needs to be checked and delegation to lazily created Sub-"Entity"Joins
are needed (removes a lot of duplicated code as seen inTaskJoins
)."Entity"Service.createUserFilter
mostly needs to be called with a"Entity"Joins
object instead of JPAJoin
as root object.Helpful code snippets
To adapt the
QueryContext
subclasses:To lazily create cascaded
QueryJoins
:The text was updated successfully, but these errors were encountered: