True, but pwi.scorer_id is a FK to a single row; on queries it appears to
only access a single row in the PeerWorkflowItem table.


On Wed, Mar 26, 2014 at 9:24 AM, David Ormsbee <notifications@github.com>wrote:

> In apps/openassessment/assessment/peer_api.py:
>
> > -        workflow.item_id,
> > -        workflow.course_id,
> > -        workflow.student_id,
> > -        workflow.id,
> > -        timeout
> > -    )
> > +    try:
> > +        peer_workflows = list(PeerWorkflow.objects.raw(
> > +            "select pw.id, pw.submission_uuid "
> > +            "from assessment_peerworkflow pw "
> > +            "left join assessment_peerworkflowitem pwi "
> > +            "on pw.id=pwi.author_id "
> > +            "where pw.item_id=%s "
> > +            "and pw.course_id=%s "
> > +            "and pw.student_id<>%s "
> > +            "and pw.id not in (select pwi.author_id from assessment_peerworkflowitem pwi where pwi.scorer_id=%s) "
>
> This sub-select isn't scoped to any problem, so it'll get bigger and
> bigger as time goes on.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-ora2/pull/208/files#r10975432>
> .
>