Distribution:+bugtarget-portlet-tags-content timeouts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Critical
|
William Grant |
Bug Description
1 SELECT BugTag.tag, COUNT(*) FROM BugTag LEFT JOIN Bug ON Bug.id = BugTag.bug LEFT JOIN BugTask ON ... ) AND BugTask.
GET: 1 Robots: 0 Local: 1
1 https:/
OOPS-1900J34
22 SELECT BugTag.tag, COUNT(*) FROM BugTag LEFT JOIN Bug ON Bug.id = BugTag.bug LEFT JOIN BugTask ON ... ) AND BugTask.
GET: 22 Robots: 0 Local: 21
15 https:/
OOPS-1921A1131, OOPS-1921A1206, OOPS-1921A194, OOPS-1921A437, OOPS-1921A788
6 https:/
OOPS-1921A240, OOPS-1921A498, OOPS-1921C644, OOPS-1921G824, OOPS-1921J719
1 https:/
OOPS-1921EA824
this query is run twice:
SELECT BugTag.tag, COUNT(*)
FROM BugTag
LEFT JOIN Bug ON Bug.id = BugTag.bug
LEFT JOIN BugTask ON BugTask.bug = Bug.id
AND BugTask.status IN (10,
WHERE BugTask.status IN (10,
AND BugTask.
AND Bug.private = FALSE
GROUP BY BugTag.tag
ORDER BY BugTag.tag
It could be simplified, changed from left join to inner joins.
Related branches
- Jeroen T. Vermeulen (community): Approve (code)
-
Diff: 430 lines (+113/-117)11 files modifiedlib/lp/bugs/browser/bugtarget.py (+28/-53)
lib/lp/bugs/doc/bug-tags.txt (+20/-12)
lib/lp/bugs/interfaces/bugtarget.py (+3/-1)
lib/lp/bugs/model/bug.py (+43/-37)
lib/lp/registry/model/distribution.py (+3/-2)
lib/lp/registry/model/distributionsourcepackage.py (+2/-2)
lib/lp/registry/model/distroseries.py (+3/-2)
lib/lp/registry/model/product.py (+3/-2)
lib/lp/registry/model/productseries.py (+3/-2)
lib/lp/registry/model/projectgroup.py (+3/-2)
lib/lp/registry/model/sourcepackage.py (+2/-2)
- Robert Collins (community): Approve
-
Diff: 12 lines (+1/-1)1 file modifiedlib/lp/bugs/templates/bugtarget-portlet-tags-content.pt (+1/-1)
description: | updated |
Changed in launchpad: | |
assignee: | nobody → William Grant (wgrant) |
status: | Triaged → In Progress |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
Original query plan (hot)
QUERY PLAN ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- - 46..265149. 57 rows=16442 width=10) (actual time=3192. 140..3192. 923 rows=6137 loops=1) 58..263957. 10 rows=16442 width=10) (actual time=3181. 959..3184. 173 rows=6137 loops=1) 43..263462. 46 rows=57823 width=10) (actual time=1683. 258..3054. 185 rows=290833 loops=1) 00..11877. 25 rows=739825 width=14) (actual time=0.014..156.715 rows=739317 loops=1) 78..241957. 78 rows=54932 width=8) (actual time=1683. 098..1683. 098 rows=177175 loops=1)
-> Nested Loop (cost=2578. 18..241957. 78 rows=54932 width=8) (actual time=117. 228..1588. 516 rows=177175 loops=1)
- > Bitmap Heap Scan on bugtask (cost=2578. 18..67612. 70 rows=54932 width=4) (actual time=117. 188..326. 646 rows=190273 loops=1)
Recheck Cond: ((status = ANY ('{10,15, 20,21,22, 25}'::integer[ ])) AND (status = ANY ('{10,15, 20,21,22, 25}'::integer[ ])))
Filter: (distribution = 1)
-> Bitmap Index Scan on bugtask_ _status_ _idx (cost=0.00..2564.45 rows=91735 width=0) (actual time=97.028..97.028 rows=308932 loops=1)
Index Cond: ((status = ANY ('{10,15, 20,21,22, 25}'::integer[ ])) AND (status = ANY ('{10,15, 20,21,22, 25}'::integer[ ])))
- > Index Scan using bug_pkey on bug (cost=0.00..3.16 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=190273)
Index Cond: (bug.id = bugtask.bug)
Filter: (NOT bug.private)
-------
Sort (cost=265108.
Sort Key: bugtag.tag
Sort Method: quicksort Memory: 567kB
-> HashAggregate (cost=263751.
-> Hash Join (cost=242644.
Hash Cond: (bugtag.bug = bug.id)
-> Seq Scan on bugtag (cost=0.
-> Hash (cost=241957.
Total runtime: 3196.765 ms
simpler:
SELECT BugTag.tag, COUNT(*) distribution = 1
FROM BugTag
JOIN Bug ON Bug.id = BugTag.bug
JOIN BugTask ON BugTask.bug = Bug.id
AND BugTask.status IN (10, 15, 20, 21, 22, 25)
WHERE BugTask.
AND Bug.private = FALSE
GROUP BY BugTag.tag
ORDER BY BugTag.tag
launchpad_ qastaging= > explain analyze SELECT BugTag.tag, COUNT(*) distribution = 1
QUERY PLAN ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -- 52..286258. 63 rows=16442 width=10) (actual time...
FROM BugTag
JOIN Bug ON Bug.id = BugTag.bug
JOIN BugTask ON BugTask.bug = Bug.id
AND BugTask.status IN (10, 15, 20, 21, 22, 25)
WHERE BugTask.
AND Bug.private = FALSE
GROUP BY BugTag.tag
ORDER BY BugTag.tag;
-------
Sort (cost=286217.