bidder explain analyze select auction_id count auction_id from impress

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
bidder=# explain analyze select auction_id, count(auction_id) from impressions where impressiondate >= '2019-02-26' and impressiondate < '2019-02-28' group by auction_id having count(auction_id) > 1;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Finalize GroupAggregate (cost=119605.15..119657.32 rows=67 width=40) (actual time=17366.948..30768.250 rows=3426 loops=1)
Group Key: impressions_y2019m02d27.auction_id
Filter: (count(impressions_y2019m02d27.auction_id) > 1)
Rows Removed by Filter: 6313438
-> Gather Merge (cost=119605.15..119651.82 rows=400 width=40) (actual time=17366.912..29118.310 rows=6318045 loops=1)
Workers Planned: 2
Workers Launched: 2
-> Sort (cost=118605.13..118605.63 rows=200 width=40) (actual time=13319.406..16766.156 rows=2106015 loops=3)
Sort Key: impressions_y2019m02d27.auction_id
Sort Method: external merge Disk: 103624kB
Worker 0: Sort Method: external merge Disk: 102392kB
Worker 1: Sort Method: external merge Disk: 149696kB
-> Partial HashAggregate (cost=118595.48..118597.48 rows=200 width=40) (actual time=1554.139..2065.507 rows=2106015 loops=3)
Group Key: impressions_y2019m02d27.auction_id
-> Parallel Append (cost=0.00..105426.59 rows=2633779 width=32) (actual time=0.197..756.503 rows=2107041 loops=3)
-> Parallel Seq Scan on impressions_y2019m02d27 (cost=0.00..48494.71 rows=1384714 width=32) (actual time=0.024..158.109 rows=1107716 loops=3)
Filter: ((impressiondate >= '2019-02-26'::date) AND (impressiondate < '2019-02-28'::date))
-> Parallel Seq Scan on impressions_y2019m02d26 (cost=0.00..43762.98 rows=1249065 width=32) (actual time=0.282..685.301 rows=1498986 loops=2)
Filter: ((impressiondate >= '2019-02-26'::date) AND (impressiondate < '2019-02-28'::date))
Planning Time: 0.480 ms
Execution Time: 30812.092 ms
(21 rows)