explain.depesz.com

PostgreSQL's explain analyze made readable

Result: n4W

Settings
# exclusive inclusive rows x rows loops node
1. 97.469 3,168.056 ↑ 32.6 731 1

HashAggregate (cost=239,531.15..1,227,041.16 rows=23,827 width=22) (actual time=3,112.115..3,168.056 rows=731 loops=1)

  • Group Key: c.ticketno
  • Filter: (max(c.departuredate) < (now() - '5 days'::interval))
  • Rows Removed by Filter: 76015
2. 389.180 3,049.388 ↓ 2.0 238,623 1

Hash Semi Join (cost=113,835.12..238,624.35 rows=120,907 width=22) (actual time=1,227.170..3,049.388 rows=238,623 loops=1)

  • Hash Cond: ((c.ticketno)::text = (gdsticketcoupon.ticketno)::text)
3. 1,437.951 1,439.154 ↓ 2.0 244,666 1

Seq Scan on gdsticketcoupon c (cost=328.56..99,396.94 rows=120,907 width=22) (actual time=3.511..1,439.154 rows=244,666 loops=1)

  • Filter: ((NOT (hashed SubPlan 4)) AND (departuredate >= (now() - '6 days'::interval)))
  • Rows Removed by Filter: 2226553
4.          

SubPlan (forSeq Scan)

5. 1.203 1.203 ↑ 1.0 8,967 1

Seq Scan on unusedtickets (cost=0.00..305.25 rows=9,325 width=14) (actual time=0.013..1.203 rows=8,967 loops=1)

6. 303.619 1,221.054 ↑ 1.0 1,514,128 1

Hash (cost=86,712.29..86,712.29 rows=1,541,382 width=14) (actual time=1,221.054..1,221.054 rows=1,514,128 loops=1)

  • Buckets: 131072 Batches: 32 Memory Usage: 3131kB
7. 917.435 917.435 ↑ 1.0 1,514,128 1

Seq Scan on gdsticketcoupon (cost=0.00..86,712.29 rows=1,541,382 width=14) (actual time=0.004..917.435 rows=1,514,128 loops=1)

  • Filter: ((couponstatus)::text = ANY ('{AirportControl,OriginalIssue,Suspended,NotAvailable}'::text[]))
  • Rows Removed by Filter: 957091
8.          

SubPlan (forHashAggregate)

9. 7.310 7.310 ↑ 1.0 1 731

Index Scan using gdsticket_pkey on gdsticket t (cost=0.42..8.44 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=731)

  • Index Cond: ((ticketno)::text = (c.ticketno)::text)
10. 5.117 5.117 ↑ 1.0 1 731

Index Scan using gdsticket_pkey on gdsticket t_1 (cost=0.42..8.44 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=731)

  • Index Cond: ((ticketno)::text = (c.ticketno)::text)
11. 1.462 8.772 ↑ 1.0 1 731

Aggregate (cost=24.53..24.54 rows=1 width=10) (actual time=0.012..0.012 rows=1 loops=731)

12. 7.310 7.310 ↑ 1.7 3 731

Index Scan using gdsticketcoupon_pkey on gdsticketcoupon gdsticketcoupon_1 (cost=0.43..24.52 rows=5 width=10) (actual time=0.009..0.010 rows=3 loops=731)

  • Index Cond: ((ticketno)::text = (c.ticketno)::text)