← Back to team overview

launchpad-dev team mailing list archive

Re: SQL/DDL help wanted to fix a distrosseries timeouts

 

> EdwinGrubbs: sinzui: I'm asking whether you can rerun it with EXPLAIN 
> ANALYZE?

Yes:

explain analyze         SELECT BugTask.sourcepackagename,
            sum(Bug.heat) AS total_heat,
            count(Bug.id) AS total_bugs 
        FROM 
            BugTask
            JOIN Bug ON bugtask.bug = Bug.id
            WHERE
                BugTask.sourcepackagename is not NULL
                AND BugTask.distribution = 1
                AND BugTask.status in (10, 15, 20, 21, 22, 25)
        GROUP BY BugTask.sourcepackagename;


 HashAggregate  (cost=131735.63..131743.54 rows=527 width=12) (actual time=2205.051..2212.577 rows=7080 loops=1)
   ->  Hash Join  (cost=97898.98..131115.61 rows=82670 width=12) (actual time=1339.243..2057.606 rows=144360 loops=1)
         Hash Cond: (bugtask.bug = bug.id)
         ->  Bitmap Heap Scan on bugtask  (cost=3032.33..32043.23 rows=82670 width=8) (actual time=89.510..289.124 rows=144360 loops=1)
               Recheck Cond: (status = ANY ('{10,15,20,21,22,25}'::integer[]))
               Filter: ((sourcepackagename IS NOT NULL) AND (distribution = 1))
               ->  Bitmap Index Scan on bugtask__status__idx  (cost=0.00..3011.67 rows=206145 width=0) (actual time=75.147..75.147 rows=235844 loops=1)
                     Index Cond: (status = ANY ('{10,15,20,21,22,25}'::integer[]))
         ->  Hash  (cost=85994.40..85994.40 rows=540740 width=8) (actual time=1249.102..1249.102 rows=522455 loops=1)
               ->  Seq Scan on bug  (cost=0.00..85994.40 rows=540740 width=8) (actual time=0.017..793.766 rows=522455 loops=1)
 Total runtime: 2218.820 ms



-- 
__Curtis C. Hovey_________
http://launchpad.net/

Attachment: signature.asc
Description: This is a digitally signed message part


References