explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vfBe

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.048 ↑ 3.0 1 1

Nested Loop Left Join (cost=5.78..41.32 rows=3 width=159) (actual time=0.048..0.048 rows=1 loops=1)

  • Join Filter: (couponmanagementtable.couponid = couponcataloguemapping.couponid)
2. 0.001 0.043 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.57..26.71 rows=1 width=122) (actual time=0.042..0.043 rows=1 loops=1)

  • Join Filter: (couponmanagementtable.couponid = couponusedmapping.couponid)
  • Filter: (couponmanagementtable.numberoftimesvalid > COALESCE(couponusedmapping.numberoftimesused, 0))
3. 0.001 0.032 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.00..18.11 rows=1 width=110) (actual time=0.031..0.032 rows=1 loops=1)

  • Join Filter: (couponmanagementtable.couponid = couponstoremapping.couponid)
4. 0.002 0.021 ↑ 1.0 1 1

Nested Loop (cost=0.43..9.51 rows=1 width=102) (actual time=0.020..0.021 rows=1 loops=1)

  • Join Filter: (couponmanagementtable.coupontypeid = coupontypetable.coupontypeid)
5. 0.016 0.016 ↑ 1.0 1 1

Index Scan using couponmanagementtable_pkey on couponmanagementtable (cost=0.43..8.46 rows=1 width=70) (actual time=0.015..0.016 rows=1 loops=1)

  • Index Cond: (couponid = 6,489,856)
  • Filter: ((couponstatus = 'active'::text) AND (startdate <= now()) AND (enddate >= now()))
6. 0.003 0.003 ↑ 2.0 1 1

Seq Scan on coupontypetable (cost=0.00..1.02 rows=2 width=40) (actual time=0.003..0.003 rows=1 loops=1)

7. 0.010 0.010 ↑ 1.0 1 1

Index Only Scan using couponstoremapping_storeid_couponid_key on couponstoremapping (cost=0.57..8.59 rows=1 width=16) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: ((storeid = 146,084) AND (couponid = 6,489,856))
  • Heap Fetches: 1
8. 0.010 0.010 ↑ 1.0 1 1

Index Scan using couponusedmapping_couponid_storeid_key on couponusedmapping (cost=0.57..8.59 rows=1 width=20) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: ((couponid = 6,489,856) AND (storeid = 146,084))
9. 0.001 0.003 ↓ 0.0 0 1

GroupAggregate (cost=4.21..14.51 rows=8 width=40) (actual time=0.003..0.003 rows=0 loops=1)

  • Group Key: couponcataloguemapping.couponid
10. 0.001 0.002 ↓ 0.0 0 1

Bitmap Heap Scan on couponcataloguemapping (cost=4.21..14.37 rows=8 width=16) (actual time=0.002..0.002 rows=0 loops=1)

  • Recheck Cond: (couponid = 6,489,856)
11. 0.001 0.001 ↓ 0.0 0 1

Bitmap Index Scan on idx_couponcataloguemapping_couponid (cost=0.00..4.21 rows=8 width=0) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (couponid = 6,489,856)
Planning time : 0.454 ms
Execution time : 0.097 ms