explain.depesz.com

PostgreSQL's explain analyze made readable

Result: X0YY

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 218.419 ↓ 0.0 0 1

Unique (cost=159,415.81..159,442.36 rows=2,655 width=52) (actual time=218.419..218.419 rows=0 loops=1)

2. 0.000 218.418 ↓ 0.0 0 1

Sort (cost=159,415.81..159,422.45 rows=2,655 width=52) (actual time=218.418..218.418 rows=0 loops=1)

  • Sort Key: coupontypetable.coupontype, couponstoremapping.storeid, couponmanagementtable.couponid
  • Sort Method: quicksort Memory: 25kB
3. 3.719 219.769 ↓ 0.0 0 1

Gather (cost=1,013.10..159,264.81 rows=2,655 width=52) (actual time=218.411..219.769 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 0.000 216.050 ↓ 0.0 0 3

Hash Left Join (cost=13.10..157,999.31 rows=1,106 width=52) (actual time=216.050..216.050 rows=0 loops=3)

  • Hash Cond: (couponmanagementtable.couponid = couponstoremapping.couponid)
5. 0.001 216.050 ↓ 0.0 0 3

Hash Join (cost=1.68..157,984.99 rows=1,106 width=40) (actual time=216.050..216.050 rows=0 loops=3)

  • Hash Cond: (couponmanagementtable.coupontypeid = coupontypetable.coupontypeid)
6. 0.001 216.049 ↓ 0.0 0 3

Nested Loop Left Join (cost=0.57..157,978.52 rows=1,106 width=16) (actual time=216.049..216.049 rows=0 loops=3)

  • Filter: (couponmanagementtable.numberoftimesvalid > COALESCE(couponusedmapping.numberoftimesused, 0))
7. 216.048 216.048 ↓ 0.0 0 3

Parallel Seq Scan on couponmanagementtable (cost=0.00..129,603.44 rows=3,319 width=20) (actual time=216.048..216.048 rows=0 loops=3)

  • Filter: ((startdate <= '2019-11-08 17:51:01'::timestamp without time zone) AND (enddate >= '2019-11-08 17:51:01'::timestamp without time zone) AND (couponcode = 'FIRST30'::text) AND (couponstatus = 'active'::text))
  • Rows Removed by Filter: 1982683
8. 0.000 0.000 ↓ 0.0 0

Index Scan using couponusedmapping_couponid_storeid_key on couponusedmapping (cost=0.57..8.54 rows=1 width=12) (never executed)

  • Index Cond: ((couponmanagementtable.couponid = couponid) AND (storeid = 5261687))
9. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.05..1.05 rows=5 width=40) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Seq Scan on coupontypetable (cost=0.00..1.05 rows=5 width=40) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Hash (cost=10.23..10.23 rows=95 width=16) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Index Only Scan using couponstoremapping_storeid_couponid_key on couponstoremapping (cost=0.57..10.23 rows=95 width=16) (never executed)

  • Index Cond: (storeid = 5261687)
  • Heap Fetches: 0
Planning time : 0.434 ms
Execution time : 219.824 ms