explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oLkS

Settings
# exclusive inclusive rows x rows loops node
1. 64.162 3,006.435 ↑ 1,197.8 25 1

GroupAggregate (cost=190,386.87..350,396.04 rows=29,945 width=22) (actual time=2,873.367..3,006.435 rows=25 loops=1)

  • Group Key: c.ticketno
  • Filter: (max(c.departuredate) < (now() - '5 days'::interval))
  • Rows Removed by Filter: 87430
2. 460.648 2,941.698 ↓ 1.9 228,714 1

Sort (cost=190,386.87..190,693.32 rows=122,580 width=22) (actual time=2,872.984..2,941.698 rows=228,714 loops=1)

  • Sort Key: c.ticketno
  • Sort Method: external merge Disk: 7600kB
3. 36.950 2,481.050 ↓ 1.9 228,714 1

Nested Loop Semi Join (cost=2,289.08..178,552.85 rows=122,580 width=22) (actual time=43.058..2,481.050 rows=228,714 loops=1)

4. 1,462.324 1,489.764 ↓ 1.9 238,584 1

Seq Scan on gdsticketcoupon c (cost=2,288.65..90,052.17 rows=122,580 width=22) (actual time=43.000..1,489.764 rows=238,584 loops=1)

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

SubPlan (forSeq Scan)

6. 27.440 27.440 ↓ 1.0 25,362 1

Index Only Scan using unusedtickets_pkey on unusedtickets (cost=0.41..2,225.27 rows=25,352 width=14) (actual time=0.086..27.440 rows=25,362 loops=1)

  • Heap Fetches: 21051
7. 954.336 954.336 ↑ 3.0 1 238,584

Index Scan using gdsticketcoupon_pkey on gdsticketcoupon c1 (cost=0.43..1.08 rows=3 width=14) (actual time=0.004..0.004 rows=1 loops=238,584)

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

SubPlan (forGroupAggregate)

9. 0.500 0.500 ↑ 1.0 1 25

Index Scan using gdsticket_pkey on gdsticket (cost=0.42..2.64 rows=1 width=8) (actual time=0.019..0.020 rows=1 loops=25)

  • Index Cond: ((ticketno)::text = (c.ticketno)::text)
10. 0.075 0.075 ↑ 1.0 1 25

Index Scan using gdsticket_pkey on gdsticket gdsticket_1 (cost=0.42..2.64 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=25)

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