This is the long query from the most recent oops at 8920.0ms:
WITH ss AS (
SELECT *
FROM StructuralSubscription
WHERE StructuralSubscription.subscriber = $INT)
SELECT BugTaskFlat.bugtask
FROM BugTaskFlat WHERE BugTaskFlat.bugtask IN (
SELECT BugTaskFlat.bugtask
FROM BugTaskFlat
LEFT JOIN Product ON BugTaskFlat.product = Product.id
AND Product.active
LEFT JOIN ss AS "_23f0" ON BugTaskFlat.product = "_23f0".product
LEFT JOIN ss AS "_23f1" ON BugTaskFlat.productseries = "_23f1".productseries
LEFT JOIN ss AS "_23f2" ON Product.project = "_23f2".project
LEFT JOIN ss AS "_23f3" ON BugTaskFlat.distribution = "_23f3".distribution
AND ("_23f3".sourcepackagename = BugTaskFlat.sourcepackagename
OR "_23f3".sourcepackagename IS NULL)
LEFT JOIN ss AS "_23f4" ON BugTaskFlat.distroseries = "_23f4".distroseries
OR "_23f4".distribution = $INT
AND BugTaskFlat.sourcepackagename = "_23f4".sourcepackagename
LEFT JOIN ss AS "_23f5" ON BugTaskFlat.milestone = "_23f5".milestone WHERE BugTaskFlat.distribution = $INT
AND BugTaskFlat.status IN ($INT ... $INT)
AND BugTaskFlat.duplicateof IS NULL
AND NULL_COUNT(ARRAY["_23f0".id, "_23f1".id, "_23f2".id, "_23f3".id, "_23f4".id, "_23f5".id]) < $INT
AND (BugTaskFlat.information_type IN ($INT, $INT)
OR COALESCE((BugTaskFlat.access_grants)&& (SELECT ARRAY_AGG(TeamParticipation.team) FROM TeamParticipation WHERE TeamParticipation.person = $INT), FALSE)
OR COALESCE((BugTaskFlat.access_policies)&& (SELECT ARRAY_AGG(AccessPolicyGrant.policy) FROM AccessPolicyGrant JOIN TeamParticipation ON TeamParticipation.team = AccessPolicyGrant.grantee WHERE TeamParticipation.person = $INT), FALSE)))
ORDER BY BugTaskFlat.heat DESC, BugTaskFlat.bugtask LIMIT $INT
OFFSET $INT
This is the long query from the most recent oops at 8920.0ms:
WITH ss AS ( ription ription. subscriber = $INT) productseries = "_23f1" .productseries distribution = "_23f3" .distribution .sourcepackagen ame = BugTaskFlat. sourcepackagena me .sourcepackagen ame IS NULL) distroseries = "_23f4" .distroseries .distribution = $INT sourcepackagena me = "_23f4" .sourcepackagen ame milestone = "_23f5".milestone WHERE BugTaskFlat. distribution = $INT duplicateof IS NULL ARRAY[" _23f0". id, "_23f1".id, "_23f2".id, "_23f3".id, "_23f4".id, "_23f5".id]) < $INT information_ type IN ($INT, $INT) (BugTaskFlat. access_ grants) &&
(SELECT ARRAY_AGG( TeamParticipati on.team)
FROM TeamParticipation
WHERE TeamParticipati on.person = $INT), FALSE) (BugTaskFlat. access_ policies) &&
(SELECT ARRAY_AGG( AccessPolicyGra nt.policy)
FROM AccessPolicyGrant
JOIN TeamParticipation ON TeamParticipati on.team = AccessPolicyGra nt.grantee
WHERE TeamParticipati on.person = $INT), FALSE)))
SELECT *
FROM StructuralSubsc
WHERE StructuralSubsc
SELECT BugTaskFlat.bugtask
FROM BugTaskFlat WHERE BugTaskFlat.bugtask IN (
SELECT BugTaskFlat.bugtask
FROM BugTaskFlat
LEFT JOIN Product ON BugTaskFlat.product = Product.id
AND Product.active
LEFT JOIN ss AS "_23f0" ON BugTaskFlat.product = "_23f0".product
LEFT JOIN ss AS "_23f1" ON BugTaskFlat.
LEFT JOIN ss AS "_23f2" ON Product.project = "_23f2".project
LEFT JOIN ss AS "_23f3" ON BugTaskFlat.
AND ("_23f3"
OR "_23f3"
LEFT JOIN ss AS "_23f4" ON BugTaskFlat.
OR "_23f4"
AND BugTaskFlat.
LEFT JOIN ss AS "_23f5" ON BugTaskFlat.
AND BugTaskFlat.status IN ($INT ... $INT)
AND BugTaskFlat.
AND NULL_COUNT(
AND (BugTaskFlat.
OR COALESCE(
OR COALESCE(
ORDER BY BugTaskFlat.heat DESC, BugTaskFlat.bugtask LIMIT $INT
OFFSET $INT