Comment 3 for bug 866100

Revision history for this message
Stuart Bishop (stub) wrote :

The following is faster still, as we know BugAffectsPerson contains at most one row per (person,bug) so can use a normal join instead of a subquery:

SELECT BugTask.*, Bug.*
FROM BugTask, Bug, BugAffectsPerson
WHERE
    Bug.id = BugTask.bug
    AND BugTask.product = 10294
    AND BugTask.status IN (10, 15, 20, 21, 22, 25)
    AND Bug.duplicateof IS NULL
    AND Bug.id = BugAffectsPerson.bug
    AND BugAffectsPerson.person = 78
    AND BugAffectsPerson.affected IS TRUE
ORDER BY Bug.date_last_updated DESC LIMIT 76 OFFSET 0;