Skip to content

Commit

Permalink
fix(crud): Use subqueryload for all joins (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
KIRA009 authored Nov 15, 2024
1 parent 712c9ea commit a73439a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openadapt/db/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from openadapt.db.db import Session, get_read_only_session_maker
from openadapt.models import (
ActionEvent,
BrowserEvent,
AudioInfo,
BrowserEvent,
MemoryStat,
PerformanceStat,
Recording,
Expand Down Expand Up @@ -573,8 +573,8 @@ def get_screenshots(
session.query(Screenshot)
.filter(Screenshot.recording_id == recording.id)
.options(
joinedload(Screenshot.action_event).joinedload(ActionEvent.recording),
subqueryload(Screenshot.action_event).joinedload(ActionEvent.screenshot),
subqueryload(Screenshot.action_event).subqueryload(ActionEvent.recording),
subqueryload(Screenshot.action_event).subqueryload(ActionEvent.screenshot),
subqueryload(Screenshot.recording),
)
.order_by(Screenshot.timestamp)
Expand Down

0 comments on commit a73439a

Please sign in to comment.