Query there has the same structsub entries etc - and works nice and fast.
SELECT BugTask.*, Bug.*
FROM BugTask
JOIN Bug ON BugTask.bug = Bug.id
WHERE Bug.id = BugTask.bug
AND BugTask.importance IN (5)
AND BugTask.distribution = 1
AND (BugTask.status IN (10))
AND Bug.duplicateof IS NULL
AND NOT EXISTS
(SELECT TRUE
FROM BugTag
WHERE BugTag.bug = Bug.id
AND BugTag.tag = 'notserv')
AND BugTask.id IN
( SELECT BugTask.id
FROM BugTask,
Product
WHERE BugTask.product = Product.id
AND Product.bug_supervisor = 343381
UNION ALL SELECT BugTask.id
FROM BugTask, StructuralSubscription
WHERE BugTask.distribution = StructuralSubscription.distribution
AND BugTask.sourcepackagename = StructuralSubscription.sourcepackagename
AND StructuralSubscription.subscriber = 343381
UNION ALL SELECT BugTask.id
FROM BugTask, Distribution
WHERE BugTask.distribution = Distribution.id
AND Distribution.bug_supervisor = 343381 )
AND Bug.private = FALSE
ORDER BY BugTask.datecreated LIMIT 76
OFFSET 0;
https:/ /lp-oops. canonical. com/oops. py/?oopsid= OOPS-61398f63dc 890e7f5cf2b3276 ae04ecf# statementlog is the page in question as an anonymous user.
Query there has the same structsub entries etc - and works nice and fast. distribution = 1 bug_supervisor = 343381
StructuralSu bscription distribution = StructuralSubsc ription. distribution sourcepackagena me = StructuralSubsc ription. sourcepackagena me ription. subscriber = 343381
Distribution distribution = Distribution.id bug_supervisor = 343381 )
SELECT BugTask.*, Bug.*
FROM BugTask
JOIN Bug ON BugTask.bug = Bug.id
WHERE Bug.id = BugTask.bug
AND BugTask.importance IN (5)
AND BugTask.
AND (BugTask.status IN (10))
AND Bug.duplicateof IS NULL
AND NOT EXISTS
(SELECT TRUE
FROM BugTag
WHERE BugTag.bug = Bug.id
AND BugTag.tag = 'notserv')
AND BugTask.id IN
( SELECT BugTask.id
FROM BugTask,
Product
WHERE BugTask.product = Product.id
AND Product.
UNION ALL SELECT BugTask.id
FROM BugTask,
WHERE BugTask.
AND BugTask.
AND StructuralSubsc
UNION ALL SELECT BugTask.id
FROM BugTask,
WHERE BugTask.
AND Distribution.
AND Bug.private = FALSE
ORDER BY BugTask.datecreated LIMIT 76
OFFSET 0;