Skip to content

Commit

Permalink
performance tuning of the database access for much faster api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ooemperor committed May 23, 2024
1 parent d53932c commit 2710b14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion codeGrader/backend/db/Exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Exercise(Base):
passive_deletes=True,
lazy="subquery",
join_depth=3,
backref=backref("TaskExercise", lazy="joined", join_depth=3)
backref=backref("TaskExercise", lazy="subquery", join_depth=3)
)

def get_profile(self):
Expand Down
5 changes: 3 additions & 2 deletions codeGrader/backend/db/Subject.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ class Subject(Base):
cascade="all",
passive_deletes=True,
lazy="subquery",
backref=backref("ExerciseSubject", lazy="joined")
join_depth=1,
backref=backref("ExerciseSubject", lazy="joined", join_depth=1)
)

memberships = relationship(
Expand All @@ -83,7 +84,7 @@ class Subject(Base):
cascade="all",
passive_deletes=True,
lazy="noload",
backref=backref("MembershipSubject", lazy="joined", join_depth=3)
backref=backref("MembershipSubject", lazy="joined", join_depth=2)
)

def get_profile(self) -> dict:
Expand Down

0 comments on commit 2710b14

Please sign in to comment.