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
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
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
GroupAggregate (cost=1.12..634609.85 rows=2107041 width=40) (actual time=0.184..10947.560 rows=3426 loops=1)
Group Key: impressions_y2019m02d26.auction_id
Filter: (count(impressions_y2019m02d26.auction_id) > 1)
Rows Removed by Filter: 6313438
-> Merge Append (cost=1.12..508187.41 rows=6321122 width=32) (actual time=0.063..9292.223 rows=6321122 loops=1)
Sort Key: impressions_y2019m02d26.auction_id
-> Index Scan using impressions_y2019m02d26_key on impressions_y2019m02d26 (cost=0.56..200970.49 rows=2997973 width=32) (actual time=0.026..6058.765 rows=2997973 loops=1)
Filter: ((impressiondate >= '2019-02-26'::date) AND (impressiondate < '2019-02-28'::date))
-> Index Scan using impressions_y2019m02d27_key on impressions_y2019m02d27 (cost=0.56..244005.69 rows=3323149 width=32) (actual time=0.034..1659.372 rows=3323149 loops=1)
Filter: ((impressiondate >= '2019-02-26'::date) AND (impressiondate < '2019-02-28'::date))
Planning Time: 0.583 ms
Execution Time: 10948.047 ms
(12 rows)