explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GDG1

Settings
# exclusive inclusive rows x rows loops node
1. 0.671 0.671 ↑ 1.0 19 1

QUERY PLANHash Right Join (cost=228.94..230.32 rows=19 width=76) (actual time=0.770..0.779 rows=19 loops=1)Hash Cond: (o.cas_id = s.cas_id)CTE _offers-> HashAggregate (cost=42.01..42.63 rows=50 width=12) (actual time=0.089..0.091 rows=7 loops=1)Group Key: dea.cas_id-> HashAggregate (cost=40.63..41.26 rows=50 width=16) (actual time=0.083..0.085 rows=11 loops=1)Group Key: dea.deal_id, dea.cas_id-> Hash Left Join (cost=20.57..39.49 rows=153 width=16) (actual time=0.009..0.066 rows=64 loops=1)Hash Cond: (dea.deal_id = deo.deal_id)-> Seq Scan on deal_activity dea (cost=0.00..13.40 rows=65 width=8) (actual time=0.004..0.051 rows=64 loops=1)Filter: ((status_id = ANY ('{8050,8320}'::integer[])) AND (created_at >= (CURRENT_TIMESTAMP - '1 year'::interval)))Rows Removed by Filter: 256-> Hash (cost=14.70..14.70 rows=470 width=12) (actual time=0.002..0.002 rows=0 loops=1)Buckets: 1024 Batches: 1 Memory Usage: 8kB-> Seq Scan on deal_offers deo (cost=0.00..14.70 rows=470 width=12) (actual time=0.001..0.001 rows=0 loops=1)CTE _stats-> GroupAggregate (cost=146.02..185.69 rows=19 width=68) (actual time=0.387..0.660 rows=19 loops=1)Group Key: dea_1.cas_id-> Sort (cost=146.02..147.90 rows=752 width=22) (actual time=0.368..0.388 rows=320 loops=1)Sort Key: dea_1.cas_idSort Method: quicksort Memory: 40kB-> Hash Right Join (cost=67.31..110.10 rows=752 width=22) (actual time=0.276..0.315 rows=320 loops=1)Hash Cond: (deo_1.deal_id = dea_1.deal_id)-> Seq Scan on deal_offers deo_1 (cost=0.00..14.70 rows=470 width=8) (actual time=0.002..0.002 rows=0 loops=1)-> Hash (cost=63.31..63.31 rows=320 width=18) (actual time=0.270..0.270 rows=320 loops=1)Buckets: 1024 Batches: 1 Memory Usage: 24kB-> Hash Left Join (cost=46.67..63.31 rows=320 width=18) (actual time=0.035..0.220 rows=320 loops=1)Hash Cond: (dea_1.deal_id = des.deal_id)-> Seq Scan on deal_activity dea_1 (cost=0.00..12.60 rows=320 width=16) (actual time=0.010..0.127 rows=320 loops=1)Filter: (created_at >= (CURRENT_TIMESTAMP - '1 year'::interval))-> Hash (cost=26.30..26.30 rows=1630 width=6) (actual time=0.009..0.009 rows=5 loops=1)Buckets: 2048 Batches: 1 Memory Usage: 17kB-> Seq Scan on deal_services des (cost=0.00..26.30 rows=1630 width=6) (actual time=0.005..0.006 rows=5 loops=1)-> CTE Scan on _offers o (cost=0.00..1.00 rows=50 width=12) (actual time=0.090..0.093 rows=7 loops=1)-> Hash (cost=0.38..0.38 rows=19 width=68) (actual time=0.675..0.675 rows=19 loops=1)Buckets: 1024 Batches: 1 Memory Usage: 10kB-> CTE Scan on _stats s (cost=0.000..0.380 rows=19 width=68) (actual time=0.389..0.671 rows=19 loops=1)

Planning time : 0.556 ms
Execution time : 0.921 ms